style edit for cmp function
This commit is contained in:
parent
12efedb205
commit
6ae68ea5e6
1 changed files with 2 additions and 4 deletions
|
@ -281,11 +281,9 @@ fn are_hardlinked(f1: &PathBuf, f2: &PathBuf) -> bool {
|
||||||
|
|
||||||
/// check equality of contents of two paths to files
|
/// check equality of contents of two paths to files
|
||||||
fn cmp(f1: &PathBuf, f2: &PathBuf) -> bool {
|
fn cmp(f1: &PathBuf, f2: &PathBuf) -> bool {
|
||||||
if let Ok(mut f1) = std::fs::File::open(f1) {
|
if let (Ok(mut f1), Ok(mut f2)) = (std::fs::File::open(f1), std::fs::File::open(f2)) {
|
||||||
if let Ok(mut f2) = std::fs::File::open(f2) {
|
|
||||||
cmp_files(&mut f1, &mut f2)
|
cmp_files(&mut f1, &mut f2)
|
||||||
} else { false }
|
} else { false }
|
||||||
} else { false }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// check equality of contents of two open files
|
/// check equality of contents of two open files
|
||||||
|
|
Loading…
Add table
Reference in a new issue