Skip to content

Commit

Permalink
Use shrink instead of shrink_left or shrink_right
Browse files Browse the repository at this point in the history
  • Loading branch information
tapanprakasht committed Oct 20, 2024
1 parent 0abafe3 commit 44c7229
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/oxc_linter/src/rules/jest/valid_title.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ fn validate_title(
if !valid_title.ignore_space && trimmed_title != title {
let (error, help) = Message::AccidentalSpace.detail();
ctx.diagnostic_with_fix(valid_title_diagnostic(error, help, span), |fixer| {
fixer.replace(span.shrink_left(1).shrink_right(1), trimmed_title.to_string())
fixer.replace(span.shrink(1), trimmed_title.to_string())
});
}

Expand All @@ -315,7 +315,7 @@ fn validate_title(
let (error, help) = Message::DuplicatePrefix.detail();
ctx.diagnostic_with_fix(valid_title_diagnostic(error, help, span), |fixer| {
let replaced_title = title[first_word.len()..].trim().to_string();
fixer.replace(span.shrink_left(1).shrink_right(1), replaced_title)
fixer.replace(span.shrink(1), replaced_title)
});
return;
}
Expand Down

0 comments on commit 44c7229

Please sign in to comment.