Skip to content

Commit 299b45e

Browse files
committed
clippy
1 parent b130097 commit 299b45e

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

gcp_uploader/src/main.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ async fn scan_and_upload_files(
212212
}
213213

214214
/// Scans directory for snapshots & uploads after deriving the associated epoch
215-
#[allow(clippy::arithmetic_side_effects)]
215+
#[allow(clippy::arithmetic_side_effects, clippy::integer_division)]
216216
async fn scan_and_upload_snapshot_files(
217217
dir_path: &Path,
218218
bucket_name: &str,
@@ -359,21 +359,22 @@ async fn emit_current_epoch_snapshot_metric(
359359
.output()
360360
.with_context(|| "Failed to execute gcloud ls for snapshot metric")?;
361361

362-
let mut uploaded = false;
363-
if list_output.status.success() {
362+
let uploaded = if list_output.status.success() {
364363
let stdout = String::from_utf8_lossy(&list_output.stdout);
365-
uploaded = stdout
364+
stdout
366365
.lines()
367-
.any(|line| line.contains("snapshot-") && line.ends_with(".tar.zst"));
368-
}
366+
.any(|line| line.contains("snapshot-") && line.ends_with(".tar.zst"))
367+
} else {
368+
false
369+
};
369370

370371
datapoint_info!(
371372
"tip_router_gcp_uploader.snapshot_present",
372-
("hostname", hostname.to_string(), String),
373-
("bucket", bucket_name.to_string(), String),
374373
("epoch", epoch as i64, i64),
375374
("present", uploaded, bool),
376375
"cluster" => cluster,
376+
"hostname" => hostname,
377+
"bucket" => bucket_name,
377378
);
378379

379380
Ok(())

0 commit comments

Comments
 (0)