Fix clippy warnings

pull/502/head
Wilfred Hughes 2023-03-31 08:15:18 +07:00
parent 8b842387a1
commit 45121f6f6d
2 changed files with 3 additions and 7 deletions

@ -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

@ -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(),
@ -318,7 +318,7 @@ fn check_only_text(
hunks: vec![],
has_byte_changes: has_changes,
has_syntactic_changes: has_changes,
};
}
}
fn diff_file_content(