Indexable#find
and #find!
with start offsets
#14642
Labels
good first issue
This is an issue suited for newcomers to become aquianted with working on the codebase.
kind:feature
topic:stdlib:collection
Indexable
has overloads ofEnumerable#index
and#index!
that accept an additional optional starting offset argument:The same is not true for
Enumerable#find
:If
x : Indexable
then it seems natural that:x.find!(offset, &block)
should be equivalent tox.unsafe_fetch(x.index!(offset, &block))
;x.find(if_none, offset, &block)
should be equivalent tox.index(offset, &block).try { |i| x.unsafe_fetch(i) }
.So I think those additional overloads should be available in
Indexable
as well, so that we don't have to write the aboveunsafe_fetch
(or even a regular#[]
call).The text was updated successfully, but these errors were encountered: