Skip to content

Commit 4f43bf7

Browse files
authored
Fix [r]searchindex deprecation (#25539)
These methods always return a single index, so first() is not needed, even though it technically works.
1 parent f27f4b8 commit 4f43bf7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

base/deprecated.jl

+4-4
Original file line numberDiff line numberDiff line change
@@ -2763,10 +2763,10 @@ end
27632763
@deprecate rsearchindex(s::AbstractString, t::AbstractString) first(findlast(t, s))
27642764
@deprecate rsearchindex(s::AbstractString, t::AbstractString, i::Integer) first(findprev(t, s, i))
27652765

2766-
@deprecate searchindex(s::AbstractString, c::Char) first(findfirst(equalto(c), s))
2767-
@deprecate searchindex(s::AbstractString, c::Char, i::Integer) first(findnext(equalto(c), s, i))
2768-
@deprecate rsearchindex(s::AbstractString, c::Char) first(findlast(equalto(c), s))
2769-
@deprecate rsearchindex(s::AbstractString, c::Char, i::Integer) first(findprev(equalto(c), s, i))
2766+
@deprecate searchindex(s::AbstractString, c::Char) findfirst(equalto(c), s)
2767+
@deprecate searchindex(s::AbstractString, c::Char, i::Integer) findnext(equalto(c), s, i)
2768+
@deprecate rsearchindex(s::AbstractString, c::Char) findlast(equalto(c), s)
2769+
@deprecate rsearchindex(s::AbstractString, c::Char, i::Integer) findprev(equalto(c), s, i)
27702770

27712771
@deprecate ismatch(r::Regex, s::AbstractString) contains(s, r)
27722772

0 commit comments

Comments
 (0)