Skip to content

Commit

Permalink
Fixed clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jsinger67 committed Aug 3, 2023
1 parent b91ac8b commit b85447f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions crates/languageserver/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -669,9 +669,9 @@ fn demangle_unexpected_token(text: &str) -> String {
}

fn to_location(token: &Token) -> Location {
let line = token.line as u32 - 1;
let column = token.column as u32 - 1;
let length = token.length as u32;
let line = token.line - 1;
let column = token.column - 1;
let length = token.length;
let uri = Url::parse(&token.file_path.to_string()).unwrap();
let range = Range::new(
Position::new(line, column),
Expand Down
4 changes: 2 additions & 2 deletions crates/parser/src/veryl_token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ fn split_comment_token(token: Token) -> Vec<Token> {
let pos = cap.start();
let length = (cap.end() - pos) as u32;

line += text[prev_pos..(pos as usize)].matches('\n').count() as u32;
line += text[prev_pos..(pos)].matches('\n').count() as u32;
prev_pos = pos;

let id = resource_table::new_token_id();
Expand All @@ -99,7 +99,7 @@ fn split_comment_token(token: Token) -> Vec<Token> {
text,
line,
column: 0,
length: length as u32,
length,
pos: pos as u32 + length,
file_path: token.file_path,
};
Expand Down

0 comments on commit b85447f

Please sign in to comment.