fix clippy errs
This commit is contained in:
+2
-2
@@ -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
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user