Skip to content

Commit f847d0f

Browse files
committed
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.
1 parent d21448b commit f847d0f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/oxc_linter/src/rules/eslint/prefer_object_has_own.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ impl Rule for PreferObjectHasOwn {
9090
let needs_space = replace_target_span.start > 1
9191
&& !ctx
9292
.source_range(Span::new(0, replace_target_span.start))
93-
.ends_with(&[' ', '=', '/', '(']);
93+
.ends_with([' ', '=', '/', '(']);
9494

9595
let replacement = if needs_space { " Object.hasOwn" } else { "Object.hasOwn" };
9696
fixer.replace(replace_target_span, replacement)

0 commit comments

Comments
 (0)