Skip to content

Commit

Permalink
(yegor256#1574) Generalize Replaced(Text,Scalar,Func)
Browse files Browse the repository at this point in the history
Co-authored-by: andreoss <andreoss@sdf.org>
  • Loading branch information
DmitryBarskov and andreoss committed Jun 25, 2021
1 parent 9c90284 commit 3bafbdc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/cactoos/text/Replaced.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public Replaced(
public Replaced(
final Text text,
final Scalar<Pattern> regex,
final Func<? super Matcher, String> func
final Func<? super Matcher, ? extends CharSequence> func
) {
super(
new Mapped(
Expand All @@ -92,7 +92,7 @@ public Replaced(
while (matcher.find()) {
matcher.appendReplacement(
buffer,
func.apply(matcher)
func.apply(matcher).toString()
);
}
matcher.appendTail(buffer);
Expand Down

0 comments on commit 3bafbdc

Please sign in to comment.