Skip to content

Commit

Permalink
turn on a lot of clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanwh committed Aug 28, 2023
1 parent 9952241 commit db70dae
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
#![warn(
clippy::all,
clippy::pedantic,
clippy::nursery,
clippy::unwrap_used,
clippy::expect_used
)]

use std::{collections::HashMap, process::ExitCode, str::FromStr};

use aws_sdk_ssm::{types::Parameter, Client};
Expand Down Expand Up @@ -122,7 +130,7 @@ fn filter_export(param: Parameter, exports: &HashMap<String, String>) -> Option<
} = param
{
let name = exports.get(&name).unwrap_or(&name);
Some((name.to_owned(), value))
Some((name.clone(), value))
} else {
None
}
Expand All @@ -138,10 +146,10 @@ fn filter_export_path(param: Parameter, path: &str) -> Option<(String, String)>
let prefix = if path.ends_with('/') {
path.to_owned()
} else {
format!("{}/", path)
format!("{path}/")
};
let name = name.strip_prefix(&prefix).unwrap_or(&name);
Some((name.to_owned(), value.to_owned()))
Some((name.to_owned(), value))
} else {
None
}
Expand Down

0 comments on commit db70dae

Please sign in to comment.