Skip to content

Commit

Permalink
style: Make clippy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Sep 3, 2024
1 parent 7f0a4e8 commit 482aa3c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions examples/clap_lex-app/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ fn parse_args() -> Result<AppArgs, BoxedError> {
} else {
let value = raw
.next_os(&mut cursor)
.ok_or_else(|| format!("`--number` is missing a value"))?;
.ok_or_else(|| "`--number` is missing a value".to_owned())?;
value.to_str().ok_or_else(|| {
format!("Value `{}` is not a number", value.to_string_lossy())
})?
Expand All @@ -93,7 +93,7 @@ fn parse_args() -> Result<AppArgs, BoxedError> {
} else {
let value = raw
.next_os(&mut cursor)
.ok_or_else(|| format!("`--number` is missing a value"))?;
.ok_or_else(|| "`--number` is missing a value".to_owned())?;
value.to_str().ok_or_else(|| {
format!("Value `{}` is not a number", value.to_string_lossy())
})?
Expand All @@ -108,7 +108,7 @@ fn parse_args() -> Result<AppArgs, BoxedError> {
} else {
let value = raw
.next_os(&mut cursor)
.ok_or_else(|| format!("`--number` is missing a value"))?;
.ok_or_else(|| "`--number` is missing a value".to_owned())?;
value.to_str().ok_or_else(|| {
format!("Value `{}` is not a number", value.to_string_lossy())
})?
Expand All @@ -120,6 +120,7 @@ fn parse_args() -> Result<AppArgs, BoxedError> {
}
}
} else if let Some(mut shorts) = arg.to_short() {
#[allow(clippy::never_loop)] // leave this refactor-proof
while let Some(short) = shorts.next_flag() {
match short {
Ok('h') => {
Expand Down

0 comments on commit 482aa3c

Please sign in to comment.