File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -29,21 +29,19 @@ use super::Error;
29
29
///
30
30
/// We use this secret to encrypt the app's [`Keyring`](crate::portal::Keyring).
31
31
#[ derive( Debug , Zeroize , ZeroizeOnDrop ) ]
32
- pub struct Secret {
33
- secret : Vec < u8 > ,
34
- }
32
+ pub struct Secret ( Vec < u8 > ) ;
35
33
36
34
impl From < Vec < u8 > > for Secret {
37
35
fn from ( secret : Vec < u8 > ) -> Self {
38
- Self { secret }
36
+ Self ( secret)
39
37
}
40
38
}
41
39
42
40
impl std:: ops:: Deref for Secret {
43
41
type Target = [ u8 ] ;
44
42
45
43
fn deref ( & self ) -> & Self :: Target {
46
- & self . secret
44
+ & self . 0
47
45
}
48
46
}
49
47
@@ -175,5 +173,5 @@ pub async fn retrieve() -> Result<Secret, Error> {
175
173
#[ cfg( feature = "tracing" ) ]
176
174
tracing:: debug!( "Secret received from the portal successfully" ) ;
177
175
178
- Ok ( Secret { secret : buf } )
176
+ Ok ( Secret :: from ( buf) )
179
177
}
You can’t perform that action at this time.
0 commit comments