refactor: clippy::map_err_ignore (#974)

This commit is contained in:
EdJoPaTo 2024-03-03 13:46:25 +01:00 committed by Josh McKinney
parent bbb6d65e06
commit 5c4efacd1d
No known key found for this signature in database
GPG key ID: 722287396A903BC5
2 changed files with 3 additions and 2 deletions

View file

@ -80,6 +80,7 @@ deref_by_slicing = "warn"
else_if_without_else = "warn" else_if_without_else = "warn"
empty_line_after_doc_comments = "warn" empty_line_after_doc_comments = "warn"
equatable_if_let = "warn" equatable_if_let = "warn"
map_err_ignore = "warn"
missing_const_for_fn = "warn" missing_const_for_fn = "warn"
redundant_type_annotations = "warn" redundant_type_annotations = "warn"
use_self = "warn" use_self = "warn"

View file

@ -49,14 +49,14 @@ impl<'a> Masked<'a> {
impl Debug for Masked<'_> { impl Debug for Masked<'_> {
/// Debug representation of a masked string is the underlying string /// Debug representation of a masked string is the underlying string
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(&self.inner).map_err(|_| fmt::Error) Display::fmt(&self.inner, f)
} }
} }
impl Display for Masked<'_> { impl Display for Masked<'_> {
/// Display representation of a masked string is the masked string /// Display representation of a masked string is the masked string
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(&self.value()).map_err(|_| fmt::Error) Display::fmt(&self.value(), f)
} }
} }