Cargo clippy

This commit is contained in:
ChristianVisintin
2021-01-16 18:02:12 +01:00
parent ac02928e69
commit 23ca2baa8c
8 changed files with 29 additions and 38 deletions

View File

@@ -167,10 +167,7 @@ impl ScpFileTransfer {
Err(_) => None,
};
// Get filesize
let filesize: usize = match metadata.get(6).unwrap().as_str().parse::<usize>() {
Ok(sz) => sz,
Err(_) => 0,
};
let filesize: usize = metadata.get(6).unwrap().as_str().parse::<usize>().unwrap_or(0);
// Get link and name
let (file_name, symlink_path): (String, Option<PathBuf>) = match is_symlink {
true => self.get_name_and_link(metadata.get(8).unwrap().as_str()),