diff --git a/src/lib.rs b/src/lib.rs index 30df8b1..d45235f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -34,7 +34,6 @@ impl Secret { Self(secret.into()) } #[inline] - #[must_use] pub fn try_from>(secret: U) -> Result> { secret.try_into().map(Self).map_err(Secret) } diff --git a/src/serde.rs b/src/serde.rs index b3af37f..071d55b 100644 --- a/src/serde.rs +++ b/src/serde.rs @@ -23,13 +23,13 @@ pub trait SerializableSecret { Self: 'a; /// To reduce the number of functions that are able to expose secrets we require /// that the [`Secret::expose_secret`] function is passed in here. - fn expose_via<'a>(&'a self, expose: impl Fn(&Secret) -> &T) -> Self::Exposed<'a>; + fn expose_via(&self, expose: impl Fn(&Secret) -> &T) -> Self::Exposed<'_>; } impl SerializableSecret for Secret { type Exposed<'a> = &'a T where T: 'a; - fn expose_via<'a>(&'a self, expose: impl Fn(&Secret) -> &T) -> Self::Exposed<'a> { + fn expose_via(&self, expose: impl Fn(&Secret) -> &T) -> Self::Exposed<'_> { expose(self) } } @@ -37,7 +37,7 @@ impl SerializableSecret for Secret { impl SerializableSecret for Option> { type Exposed<'a> = Option<&'a T> where T: 'a; - fn expose_via<'a>(&'a self, expose: impl Fn(&Secret) -> &T) -> Self::Exposed<'a> { + fn expose_via(&self, expose: impl Fn(&Secret) -> &T) -> Self::Exposed<'_> { self.as_ref().map(expose) } }