Skip to content

Commit f026266

Browse files
author
liv
committed
chore: appease clippy and cargo check
1 parent 8d8dc5b commit f026266

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

src/local.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,11 @@ impl LocalAsset {
147147
details,
148148
});
149149
}
150-
} else {
151-
if let Err(details) = fs::remove_file(&dest_path) {
152-
return Err(AxoassetError::LocalAssetRemoveFailed {
153-
dest_path: dest_path.display().to_string(),
154-
details,
155-
});
156-
}
150+
} else if let Err(details) = fs::remove_file(&dest_path) {
151+
return Err(AxoassetError::LocalAssetRemoveFailed {
152+
dest_path: dest_path.display().to_string(),
153+
details,
154+
});
157155
}
158156

159157
Ok(())

tests/local_remove.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ fn it_removes_both_file_and_directory() {
77
let file_path = Path::new(&dest.as_os_str()).join("subdir").join("test.md");
88
let dir_path = Path::new(&dest.as_os_str()).join("subdir");
99

10-
fs::create_dir_all(&file_path.parent().unwrap());
10+
fs::create_dir_all(&file_path.parent().unwrap()).unwrap();
1111
fs::write(&file_path, "hello").unwrap();
1212

13-
axoasset::LocalAsset::remove(&file_path.display().to_string());
13+
axoasset::LocalAsset::remove(&file_path.display().to_string()).unwrap();
1414
assert!(!file_path.exists());
1515

16-
axoasset::LocalAsset::remove(&dir_path.display().to_string());
16+
axoasset::LocalAsset::remove(&dir_path.display().to_string()).unwrap();
1717
assert!(!dir_path.exists());
1818
}

0 commit comments

Comments
 (0)