enforce stricter lints, drop discarded results properly
This commit is contained in:
@@ -187,7 +187,7 @@ impl Config {
|
||||
e,
|
||||
backup
|
||||
);
|
||||
let _ = std::fs::copy(path, &backup);
|
||||
drop(std::fs::copy(path, &backup));
|
||||
let cfg = Self::default();
|
||||
cfg.save(path)?;
|
||||
Ok(cfg)
|
||||
@@ -235,7 +235,7 @@ fn sweep_stale_backups(config_path: &Path) {
|
||||
if let Some(rest) = name.strip_prefix("config-").and_then(|s| s.strip_suffix(".toml.bak")) {
|
||||
if let Ok(ts) = rest.parse::<u64>() {
|
||||
if now.saturating_sub(ts) > MAX_AGE_SECS {
|
||||
let _ = std::fs::remove_file(entry.path());
|
||||
drop(std::fs::remove_file(entry.path()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -272,7 +272,7 @@ mod tests {
|
||||
};
|
||||
|
||||
let dir = std::env::temp_dir().join(format!("bytesize-test-{}", std::process::id()));
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
drop(std::fs::remove_dir_all(&dir));
|
||||
std::fs::create_dir_all(&dir).unwrap();
|
||||
let path = dir.join("config.toml");
|
||||
cfg.save(&path).unwrap();
|
||||
@@ -282,7 +282,7 @@ mod tests {
|
||||
assert_eq!(loaded.hotkeys.start, Some("F9".to_string()));
|
||||
assert_eq!(loaded.output_dir, Some(PathBuf::from("./custom")));
|
||||
assert_eq!(loaded.theme, Theme::Light);
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
drop(std::fs::remove_dir_all(&dir));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user