Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,16 @@ jobs:
with:
cache-key: warm
components: clippy
tools: ast-grep
- run: cargo lint -- -D warnings
- name: Check Char and Byte Offset
run: |
output=$(sg -p '$A.chars().enumerate()' -r '$A.char_indices()' -l rs)
echo "Output: $output"
if [ -n "$output" ]; then
echo "Error: Unexpected output detected"
exit 1
fi

doc:
name: Doc
Expand Down
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