Skip to content

Commit 564354e

Browse files
committed
Remove incorrect Proc.new usage
1 parent c66b62a commit 564354e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/ruby/truffleruby/core/enumerable.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def chunk(&original_block)
7373
end
7474

7575
def chunk_while(&block)
76-
block = Proc.new(block)
76+
raise ArgumentError, 'tried to create Proc object without a block' unless block
7777
Enumerator.new do |yielder|
7878
accumulator = nil
7979
prev = nil
@@ -246,7 +246,7 @@ def slice_before(arg = undefined, &block)
246246
end
247247

248248
def slice_when(&block)
249-
block = Proc.new(block)
249+
raise ArgumentError, 'tried to create Proc object without a block' unless block
250250
Enumerator.new do |yielder|
251251
accumulator = nil
252252
prev = nil

0 commit comments

Comments
 (0)