Fix type signature of StringInreplaceExtension
This commit is contained in:
parent
b0cd9dba99
commit
7eadf32a03
@ -18,7 +18,7 @@ class StringInreplaceExtension
|
|||||||
# Same as `String#sub!`, but warns if nothing was replaced.
|
# Same as `String#sub!`, but warns if nothing was replaced.
|
||||||
#
|
#
|
||||||
# @api public
|
# @api public
|
||||||
sig { params(before: String, after: String).returns(T.nilable(String)) }
|
sig { params(before: T.any(Regexp, String), after: String).returns(T.nilable(String)) }
|
||||||
def sub!(before, after)
|
def sub!(before, after)
|
||||||
result = inreplace_string.sub!(before, after)
|
result = inreplace_string.sub!(before, after)
|
||||||
errors << "expected replacement of #{before.inspect} with #{after.inspect}" unless result
|
errors << "expected replacement of #{before.inspect} with #{after.inspect}" unless result
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user