mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 04:08:41 +00:00
refactor(linter): call str::ends_with with array not slice (#7526)
Arrays are more performant than slices where it's possible to use them. Caught by newly enabled lint rule in Rust 1.82.0 in #6649.
This commit is contained in:
parent
d21448bf65
commit
f847d0f161
1 changed files with 1 additions and 1 deletions
|
|
@ -90,7 +90,7 @@ impl Rule for PreferObjectHasOwn {
|
|||
let needs_space = replace_target_span.start > 1
|
||||
&& !ctx
|
||||
.source_range(Span::new(0, replace_target_span.start))
|
||||
.ends_with(&[' ', '=', '/', '(']);
|
||||
.ends_with([' ', '=', '/', '(']);
|
||||
|
||||
let replacement = if needs_space { " Object.hasOwn" } else { "Object.hasOwn" };
|
||||
fixer.replace(replace_target_span, replacement)
|
||||
|
|
|
|||
Loading…
Reference in a new issue