Skip to content

Commit

Permalink
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 6 additions & 0 deletions src/enumerable.cr
Original file line number Diff line number Diff line change
@@ -27,6 +27,12 @@
# producing an `Array` as the result. For a lazy alternative refer to
# the `Iterator` and `Iterable` modules.
module Enumerable(T)
class EmptyError < Exception
def initialize(message = "Empty enumerable")
super(message)
end
end

# Must yield this collection's elements to the block.
abstract def each(&block : T -> _)

8 changes: 0 additions & 8 deletions src/exception.cr
Original file line number Diff line number Diff line change
@@ -175,14 +175,6 @@ class Exception
end
end

module Enumerable(T)
class EmptyError < Exception
def initialize(message = "Empty enumerable")
super(message)
end
end
end

# Raised when the given index is invalid.
#
# ```
2 changes: 2 additions & 0 deletions src/iterator.cr
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require "./enumerable"

# An Iterator allows processing sequences lazily, as opposed to `Enumerable` which processes
# sequences eagerly and produces an `Array` in most of its methods.
#

0 comments on commit 1ac06a5

Please sign in to comment.