Skip to content

Commit

Permalink
Fix more clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
QuarticCat committed Sep 27, 2022
1 parent fa44d4c commit d3cd293
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/diff/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ pub fn get_set_neighbours<'syn, 'b>(
}
}
assert!(
res.len() > 0,
!res.is_empty(),
"Must always find some next steps if node is not the end"
);

Expand Down
2 changes: 1 addition & 1 deletion src/display/style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ pub fn split_and_apply(
let end_col = span.end_col as usize;

// The remaining spans are beyond the end of this line_part.
if start_col >= part_start + byte_len(&line_part) {
if start_col >= part_start + byte_len(line_part) {
break;
}

Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ fn main() {
print!("{}", name);

let mut extensions: Vec<&str> = (*extensions).into();
extensions.sort();
extensions.sort_unstable();

for extension in extensions {
print!(" .{}", extension);
Expand Down
2 changes: 1 addition & 1 deletion src/parse/guess_language.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ pub fn language_name(language: Language) -> &'static str {
}
}

pub const LANG_EXTENSIONS: &'static [(Language, &[&str])] = &[
pub const LANG_EXTENSIONS: &[(Language, &[&str])] = &[
(
Bash,
&[
Expand Down
2 changes: 1 addition & 1 deletion src/parse/syntax.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ impl<'a> Syntax<'a> {
) -> &'a Syntax<'a> {
// If a parser hasn't cleaned up \r on CRLF files with
// comments, discard it.
if content.ends_with("\r") {
if content.ends_with('\r') {
content = &content[..content.len() - 1];
}

Expand Down

0 comments on commit d3cd293

Please sign in to comment.