Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
refactor(oxc): ban index methods on std::str::Chars
  • Loading branch information
shulaoda authored and Boshen committed Oct 10, 2024
commit 100b0cdf4627c29d8c24f07452251e55553493b9
4 changes: 2 additions & 2 deletions crates/oxc_linter/src/rules/nextjs/no_typos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ fn min_distance(a: &str, b: &str) -> usize {

let mut previous_row: Vec<usize> = (0..=n).collect();

for (i, s1) in a.chars().enumerate() {
for (i, s1) in a.char_indices() {
let mut current_row = vec![i + 1];
for (j, s2) in b.chars().enumerate() {
for (j, s2) in b.char_indices() {
let insertions = previous_row[j + 1] + 1;
let deletions = current_row[j] + 1;
let substitutions = previous_row[j] + usize::from(s1 != s2);
Expand Down