1 #![warn(clippy::map_err_ignore)]
2 #![allow(clippy::unnecessary_wraps)]
3 use std::convert::TryFrom;
12 impl Error for Errors {}
14 impl fmt::Display for Errors {
15 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
20 fn main() -> Result<(), Errors> {
21 let x = u32::try_from(-123_i32);
23 println!("{:?}", x.map_err(|_| Errors::Ignored));
25 // Should not warn you because you explicitly ignore the parameter
26 // using a named wildcard value
27 println!("{:?}", x.map_err(|_foo| Errors::Ignored));