1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Add Enumerable::Lazy#with_index to NEWS-2.7.0

The behavior of `Enumerable::Lazy#with_index` has changed in Ruby 2.7.
This change was not listed in the Ruby 2.7 news, so I added it.
This commit is contained in:
manga_osyo 2021-02-25 17:20:50 +09:00 committed by Hiroshi SHIBATA
parent 49cc7709cb
commit 8d378fd28b
Notes: git 2022-01-15 09:09:32 +09:00

View file

@ -357,6 +357,16 @@ See also Warning in {Core classes updates}[#label-Core+classes+updates+-28outsta
can be directly passed to another method as a block
argument. [Feature #15618]
* Added Enumerator::Lazy#with_index be lazy
Previously, Enumerator::Lazy#with_index was not defined, so it
picked up the default implementation from Enumerator, which was
not lazy. [Bug #7877]
("a"..).lazy.with_index(1) { |it, index| puts "#{index}:#{it}" }.take(3).force
# => 1:a
# 2:b
# 3:c
[Fiber]
[New method]