Skip to content

Commit

Permalink
fix: Apply clippy suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
orhun committed Mar 16, 2024
1 parent 16f7f39 commit 1438ea9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/app/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,7 @@ impl FromStr for Command {
let key_id = args.get(1).cloned().unwrap_or_default();
Ok(Command::DeleteKey(
KeyType::from_str(
&args
.get(0)
&args.first()
.cloned()
.unwrap_or_else(|| String::from("pub")),
)?,
Expand Down Expand Up @@ -280,11 +279,11 @@ impl FromStr for Command {
))
}
"set" | "s" => Ok(Command::Set(
args.get(0).cloned().unwrap_or_default(),
args.first().cloned().unwrap_or_default(),
args.get(1).cloned().unwrap_or_default(),
)),
"get" | "g" => {
Ok(Command::Get(args.get(0).cloned().unwrap_or_default()))
Ok(Command::Get(args.first().cloned().unwrap_or_default()))
}
"mode" | "m" => Ok(Command::SwitchMode(Mode::from_str(
&args.first().cloned().ok_or(())?,
Expand Down

0 comments on commit 1438ea9

Please sign in to comment.