From 2a586612bfb739a0d4e82fb5872c8d54b43833b9 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Fri, 11 Aug 2023 20:21:51 -0700 Subject: [PATCH] Resolve ignored_unit_patterns pedantic clippy lint 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 --- src/date.rs | 2 +- src/release.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/date.rs b/src/date.rs index 5cdb691..aa4e710 100644 --- a/src/date.rs +++ b/src/date.rs @@ -22,7 +22,7 @@ impl Display for Date { } pub fn parse(paren: Group, iter: Iter) -> Result { - try_parse(iter).map_err(|_| { + try_parse(iter).map_err(|()| { let msg = format!("expected nightly date, like {}", time::today()); Error::group(paren, msg) }) diff --git a/src/release.rs b/src/release.rs index 3f421c6..c8c0219 100644 --- a/src/release.rs +++ b/src/release.rs @@ -10,7 +10,7 @@ pub struct Release { } pub fn parse(paren: Group, iter: Iter) -> Result { - 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 {