diff --git a/src/serde.rs b/src/serde.rs index 071d55b..0e38e77 100644 --- a/src/serde.rs +++ b/src/serde.rs @@ -26,6 +26,14 @@ pub trait SerializableSecret { 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(&self, expose: impl Fn(&Secret) -> &T) -> Self::Exposed<'_> { + expose(self) + } +} + impl SerializableSecret for Secret { type Exposed<'a> = &'a T where T: 'a;