Silence Rust 1.45 Clippy warnings (#2196)

* Silence Rust 1.45 Clippy warnings dealing with using `map_err()`

* Silence false Clippy warning

* Fix last Clippy error for unnecessary conversion

* Fix `and_then` clippy warnings
This commit is contained in:
Joseph T. Lyons
2020-07-17 13:57:15 -04:00
committed by GitHub
parent 0f688d7da7
commit f26151e36d
6 changed files with 17 additions and 32 deletions

View File

@ -233,9 +233,9 @@ impl Signature {
desc: impl Into<String>,
short: Option<char>,
) -> Signature {
let s = short.and_then(|c| {
let s = short.map(|c| {
debug_assert!(!self.get_shorts().contains(&c));
Some(c)
c
});
self.named.insert(
name.into(),
@ -253,9 +253,9 @@ impl Signature {
desc: impl Into<String>,
short: Option<char>,
) -> Signature {
let s = short.and_then(|c| {
let s = short.map(|c| {
debug_assert!(!self.get_shorts().contains(&c));
Some(c)
c
});
self.named.insert(
@ -273,12 +273,12 @@ impl Signature {
desc: impl Into<String>,
short: Option<char>,
) -> Signature {
let s = short.and_then(|c| {
let s = short.map(|c| {
debug_assert!(
!self.get_shorts().contains(&c),
"There may be duplicate short flags, such as -h"
);
Some(c)
c
});
self.named