|
|
@ -1386,7 +1386,9 @@ impl RegExp { |
|
|
|
// the substring of S from nextSourcePosition to position, and replacement.
|
|
|
|
// the substring of S from nextSourcePosition to position, and replacement.
|
|
|
|
accumulated_result = format!( |
|
|
|
accumulated_result = format!( |
|
|
|
"{accumulated_result}{}{replacement}", |
|
|
|
"{accumulated_result}{}{replacement}", |
|
|
|
arg_str.get(next_source_position..position).unwrap(), |
|
|
|
arg_str |
|
|
|
|
|
|
|
.get(next_source_position..position) |
|
|
|
|
|
|
|
.expect("index of a regexp match cannot be greater than the input string"), |
|
|
|
) |
|
|
|
) |
|
|
|
.into(); |
|
|
|
.into(); |
|
|
|
|
|
|
|
|
|
|
@ -1404,7 +1406,9 @@ impl RegExp { |
|
|
|
Ok(format!( |
|
|
|
Ok(format!( |
|
|
|
"{}{}", |
|
|
|
"{}{}", |
|
|
|
accumulated_result, |
|
|
|
accumulated_result, |
|
|
|
arg_str.get(next_source_position..).unwrap() |
|
|
|
arg_str |
|
|
|
|
|
|
|
.get(next_source_position..) |
|
|
|
|
|
|
|
.expect("next_source_position cannot be greater than the input string") |
|
|
|
) |
|
|
|
) |
|
|
|
.into()) |
|
|
|
.into()) |
|
|
|
} |
|
|
|
} |
|
|
|