Skip to content

Commit

Permalink
chore: update deprecated index_last to last_index (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
ttytm authored Mar 29, 2024
1 parent 180b5d3 commit fdf58fd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/server/inspections/compiler/utils.v
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ fn exec_compiler_diagnostics(compiler_path string, uri lsp.DocumentUri) ?[]inspe
...report
filepath: os.join_path_single(dir_path, report.filepath)
}
} else if start_idx := dir_path.index_last(file_dir_path) {
} else if start_idx := dir_path.last_index(file_dir_path) {
// reported file appears to be in a subdirectory of dir_path
report = inspections.Report{
...report
Expand Down
2 changes: 1 addition & 1 deletion src/tests/testdata/benchmarks/checker.v
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ fn (mut c Checker) check_valid_snake_case(name string, identifier string, pos to
}

fn stripped_name(name string) string {
idx := name.index_last('.') or { -1 }
idx := name.last_index('.') or { -1 }
return name[(idx + 1)..]
}

Expand Down

0 comments on commit fdf58fd

Please sign in to comment.