Skip to content

Commit

Permalink
Clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Wilfred committed Aug 16, 2023
1 parent 6b1c82e commit 191f42e
Showing 1 changed file with 18 additions and 20 deletions.
38 changes: 18 additions & 20 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -464,20 +464,20 @@ fn diff_file_content(
None => {
let file_format = FileFormat::PlainText;
if diff_options.check_only {
return check_only_text(&file_format, display_path, extra_info, &lhs_src, &rhs_src);
return check_only_text(&file_format, display_path, extra_info, lhs_src, rhs_src);
}

let lhs_positions = line_parser::change_positions(&lhs_src, &rhs_src);
let rhs_positions = line_parser::change_positions(&rhs_src, &lhs_src);
let lhs_positions = line_parser::change_positions(lhs_src, rhs_src);
let rhs_positions = line_parser::change_positions(rhs_src, lhs_src);
(file_format, lhs_positions, rhs_positions)
}
Some(ts_lang) => {
let arena = Arena::new();
match tsp::to_tree_with_limit(diff_options, &ts_lang, &lhs_src, &rhs_src) {
match tsp::to_tree_with_limit(diff_options, &ts_lang, lhs_src, rhs_src) {
Ok((lhs_tree, rhs_tree)) => {
match tsp::to_syntax_with_limit(
&lhs_src,
&rhs_src,
lhs_src,
rhs_src,
&lhs_tree,
&rhs_tree,
&arena,
Expand Down Expand Up @@ -534,10 +534,8 @@ fn diff_file_content(
}

if exceeded_graph_limit {
let lhs_positions =
line_parser::change_positions(&lhs_src, &rhs_src);
let rhs_positions =
line_parser::change_positions(&rhs_src, &lhs_src);
let lhs_positions = line_parser::change_positions(lhs_src, rhs_src);
let rhs_positions = line_parser::change_positions(rhs_src, lhs_src);
(
FileFormat::TextFallback {
reason: "exceeded DFT_GRAPH_LIMIT".into(),
Expand All @@ -558,11 +556,11 @@ fn diff_file_content(

if diff_options.ignore_comments {
let lhs_comments =
tsp::comment_positions(&lhs_tree, &lhs_src, &ts_lang);
tsp::comment_positions(&lhs_tree, lhs_src, &ts_lang);
lhs_positions.extend(lhs_comments);

let rhs_comments =
tsp::comment_positions(&rhs_tree, &rhs_src, &ts_lang);
tsp::comment_positions(&rhs_tree, rhs_src, &ts_lang);
rhs_positions.extend(rhs_comments);
}

Expand All @@ -587,13 +585,13 @@ fn diff_file_content(
&file_format,
display_path,
extra_info,
&lhs_src,
&rhs_src,
lhs_src,
rhs_src,
);
}

let lhs_positions = line_parser::change_positions(&lhs_src, &rhs_src);
let rhs_positions = line_parser::change_positions(&rhs_src, &lhs_src);
let lhs_positions = line_parser::change_positions(lhs_src, rhs_src);
let rhs_positions = line_parser::change_positions(rhs_src, lhs_src);
(file_format, lhs_positions, rhs_positions)
}
}
Expand All @@ -611,13 +609,13 @@ fn diff_file_content(
&file_format,
display_path,
extra_info,
&lhs_src,
&rhs_src,
lhs_src,
rhs_src,
);
}

let lhs_positions = line_parser::change_positions(&lhs_src, &rhs_src);
let rhs_positions = line_parser::change_positions(&rhs_src, &lhs_src);
let lhs_positions = line_parser::change_positions(lhs_src, rhs_src);
let rhs_positions = line_parser::change_positions(rhs_src, lhs_src);
(file_format, lhs_positions, rhs_positions)
}
}
Expand Down

0 comments on commit 191f42e

Please sign in to comment.