fix clippy errs

This commit is contained in:
2026-08-22 20:54:43 +01:00
parent 30a4476643
commit a7cd06d40d
2 changed files with 11 additions and 12 deletions
+2 -2
View File
@@ -1142,8 +1142,8 @@ mod tests {
let months: HashSet<_> = body.iter().map(|r| r.month.as_str()).collect();
let species: HashSet<_> = body.iter().map(|r| r.species_code.as_str()).collect();
assert!(months.len() >= 1);
assert!(species.len() >= 1);
assert!(!months.is_empty());
assert!(!species.is_empty());
for row in &body {
assert!(!row.species_code.is_empty());
+9 -10
View File
@@ -60,16 +60,15 @@ fn cleanup_stale_parquet_files() {
match std::fs::read_dir(&tmp_dir) {
Ok(entries) => {
for entry in entries.filter_map(|e| e.ok()) {
if let Some(name) = entry.file_name().to_str() {
if name.starts_with("hagfish-") && name.ends_with(".parquet") {
if let Ok(metadata) = entry.metadata() {
if let Ok(modified) = metadata.modified() {
let age = std::time::SystemTime::now().duration_since(modified);
if age.map(|d| d.as_secs() > 3600).unwrap_or(false) {
let _ = std::fs::remove_file(entry.path());
}
}
}
if let Some(name) = entry.file_name().to_str()
&& name.starts_with("hagfish-")
&& name.ends_with(".parquet")
&& let Ok(metadata) = entry.metadata()
&& let Ok(modified) = metadata.modified()
{
let age = std::time::SystemTime::now().duration_since(modified);
if age.map(|d| d.as_secs() > 3600).unwrap_or(false) {
let _ = std::fs::remove_file(entry.path());
}
}
}