Skip to content

Commit

Permalink
Resolve ignored_unit_patterns pedantic clippy lint
Browse files Browse the repository at this point in the history
    warning: matching over `()` is more explicit
      --> src/date.rs:25:30
       |
    25 |     try_parse(iter).map_err(|_| {
       |                              ^ help: use `()` instead of `_`: `()`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
       = note: `-W clippy::ignored-unit-patterns` implied by `-W clippy::pedantic`

    warning: matching over `()` is more explicit
      --> src/release.rs:13:30
       |
    13 |     try_parse(iter).map_err(|_| Error::group(paren, "expected rustc release number, like 1.31"))
       |                              ^ help: use `()` instead of `_`: `()`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
  • Loading branch information
dtolnay committed Aug 12, 2023
1 parent f4bbc8f commit 2a58661
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/date.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ impl Display for Date {
}

pub fn parse(paren: Group, iter: Iter) -> Result<Date> {
try_parse(iter).map_err(|_| {
try_parse(iter).map_err(|()| {
let msg = format!("expected nightly date, like {}", time::today());
Error::group(paren, msg)
})
Expand Down
2 changes: 1 addition & 1 deletion src/release.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub struct Release {
}

pub fn parse(paren: Group, iter: Iter) -> Result<Release> {
try_parse(iter).map_err(|_| Error::group(paren, "expected rustc release number, like 1.31"))
try_parse(iter).map_err(|()| Error::group(paren, "expected rustc release number, like 1.31"))
}

fn try_parse(iter: Iter) -> Result<Release, ()> {
Expand Down

0 comments on commit 2a58661

Please sign in to comment.