Skip to content

Commit

Permalink
refactor: fixed clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinFillon committed Feb 17, 2024
1 parent 06d4775 commit 6be779c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions src/options/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,8 @@ impl TypedValueParser for TimeFormatParser {
// - there is nothing after `+`
// line 1 will be empty when:
// - `+` is followed immediately by `\n`
let non_recent = match lines.next() {
Some(s) => s,
None => {
let Some(non_recent) = lines.next() else
{
return Err(Error::raw(
clap::error::ErrorKind::InvalidValue,
format!(
Expand All @@ -300,8 +299,7 @@ impl TypedValueParser for TimeFormatParser {
For example: +\"%Y-%m-%d %H:%M:%S\"",
),
))
}
};
};
let non_recent = if non_recent.is_empty() {
return Err(Error::raw(
clap::error::ErrorKind::InvalidValue,
Expand Down
2 changes: 1 addition & 1 deletion tests/gen/long_time_style_custom_recent_empty_nix.stderr
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
thread 'main' panicked at 'Custom timestamp format for recent files is empty, please supply a chrono format string at the second line.', src/options/parser.rs:328:29
thread 'main' panicked at 'Custom timestamp format for recent files is empty, please supply a chrono format string at the second line.', src/options/parser.rs:326:29
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

0 comments on commit 6be779c

Please sign in to comment.