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