Skip to content

Commit

Permalink
Fix 1.67 clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
str4d committed Jul 30, 2024
1 parent 24e6e6f commit 3401108
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 15 deletions.
2 changes: 1 addition & 1 deletion examples/generate-docs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::io::prelude::*;
const MANPAGES_DIR: &str = "./target/manpages";

fn generate_manpage(page: String, name: &str) {
let file = File::create(format!("{}/{}.1.gz", MANPAGES_DIR, name))
let file = File::create(format!("{MANPAGES_DIR}/{name}.1.gz"))
.expect("Should be able to open file in target directory");
let mut encoder = GzEncoder::new(file, Compression::best());
encoder
Expand Down
2 changes: 1 addition & 1 deletion src/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ pub(crate) fn manage(yubikey: &mut YubiKey) -> Result<(), Error> {
let pin = request_pin(
|prev_error| {
if let Some(err) = prev_error {
eprintln!("{}", err);
eprintln!("{err}");
}
Password::new()
.with_prompt(fl!("mgr-choose-new-pin"))
Expand Down
18 changes: 6 additions & 12 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,8 @@ fn list(flags: PluginFlags, all: bool) -> Result<(), Error> {
flags,
all,
|_, recipient, metadata| {
println!("{}", metadata);
println!("{}", recipient);
println!("{metadata}");
println!("{recipient}");
},
)
}
Expand Down Expand Up @@ -411,9 +411,9 @@ fn main() -> Result<(), Error> {
.validity()
.not_before
.to_rfc2822()
.unwrap_or_else(|e| format!("Invalid date: {}", e));
.unwrap_or_else(|e| format!("Invalid date: {e}"));

format!("{}, created: {}", name, created)
format!("{name}, created: {created}")
})
})
})
Expand Down Expand Up @@ -631,14 +631,8 @@ fn main() -> Result<(), Error> {
// If `rage` binary is installed, use it in examples. Otherwise default to `age`.
let age_binary = which::which("rage").map(|_| "rage").unwrap_or("age");

let encrypt_usage = format!(
"$ cat foo.txt | {} -r {} -o foo.txt.age",
age_binary, recipient
);
let decrypt_usage = format!(
"$ cat foo.txt.age | {} -d -i {} > foo.txt",
age_binary, file_name
);
let encrypt_usage = format!("$ cat foo.txt | {age_binary} -r {recipient} -o foo.txt.age");
let decrypt_usage = format!("$ cat foo.txt.age | {age_binary} -d -i {file_name} > foo.txt");
let identity_usage = format!(
"$ age-plugin-yubikey -i --serial {} --slot {} > {}",
stub.serial,
Expand Down
2 changes: 1 addition & 1 deletion src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ impl Metadata {
.validity()
.not_before
.to_rfc2822()
.unwrap_or_else(|e| format!("Invalid date: {}", e)),
.unwrap_or_else(|e| format!("Invalid date: {e}")),
pin_policy,
touch_policy,
})
Expand Down

0 comments on commit 3401108

Please sign in to comment.