Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Wilfred committed Mar 31, 2023
1 parent 8b84238 commit 45121f6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 1 addition & 5 deletions src/files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,7 @@ pub fn read_or_die(path: &Path) -> Vec<u8> {
}

fn has_utf16_byte_order_mark(bytes: &[u8]) -> bool {
match &bytes {
[0xfe, 0xff, ..] => true,
[0xff, 0xfe, ..] => true,
_ => false,
}
matches!(bytes, [0xfe, 0xff, ..] | [0xff, 0xfe, ..])
}

/// Group bytes into u16 values for conversion to UTF-16, respecting
Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ fn check_only_text(
) -> DiffResult {
let has_changes = lhs_src != rhs_src;

return DiffResult {
DiffResult {
lhs_display_path: lhs_display_path.into(),
rhs_display_path: rhs_display_path.into(),
file_format: file_format.clone(),
Expand All @@ -318,7 +318,7 @@ fn check_only_text(
hunks: vec![],
has_byte_changes: has_changes,
has_syntactic_changes: has_changes,
};
}
}

fn diff_file_content(
Expand Down

0 comments on commit 45121f6

Please sign in to comment.