Skip to content

Commit

Permalink
Fix a few clippy issues
Browse files Browse the repository at this point in the history
  • Loading branch information
phyber committed Jul 26, 2023
1 parent 9860693 commit f254aec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
10 changes: 4 additions & 6 deletions src/cloudwatch/bucket_metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,8 @@ impl From<Vec<Metric>> for BucketMetrics {

for metric in metrics {
// Get the dimensions if any, otherwise skip to next iteration
let dimensions = match metric.dimensions() {
Some(d) => d,
None => continue,
let Some(dimensions) = metric.dimensions() else {
continue
};

// Storage for what we'll pull out of the dimensions
Expand All @@ -61,9 +60,8 @@ impl From<Vec<Metric>> for BucketMetrics {
// Process the dimensions, taking the bucket name and storage types
for dimension in dimensions {
// Extract the dimension name
let dimension_name = match dimension.name() {
Some(n) => n,
None => continue,
let Some(dimension_name) = dimension.name() else {
continue
};

match dimension_name {
Expand Down
5 changes: 2 additions & 3 deletions src/cloudwatch/bucket_sizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,8 @@ impl BucketSizer for Client {
let metric_statistics = self.get_metric_statistics(bucket).await?;
for stats in metric_statistics {
// If we don't get any datapoints, proceed to the next input.
let mut datapoints = match stats.datapoints {
Some(d) => d,
None => continue,
let Some(mut datapoints) = stats.datapoints else {
continue
};

// It's possible that CloudWatch could return nothing. Return an
Expand Down

0 comments on commit f254aec

Please sign in to comment.