File tree 5 files changed +10
-10
lines changed
5 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -23,9 +23,9 @@ pub struct Secret<'a> {
23
23
}
24
24
25
25
impl < ' a > Secret < ' a > {
26
- pub ( crate ) fn new < P : AsRef < [ u8 ] > > (
26
+ pub ( crate ) fn new (
27
27
session : Arc < Session < ' a > > ,
28
- secret : P ,
28
+ secret : impl AsRef < [ u8 ] > ,
29
29
content_type : & str ,
30
30
) -> Self {
31
31
Self {
@@ -36,9 +36,9 @@ impl<'a> Secret<'a> {
36
36
}
37
37
}
38
38
39
- pub ( crate ) fn new_encrypted < P : AsRef < [ u8 ] > > (
39
+ pub ( crate ) fn new_encrypted (
40
40
session : Arc < Session < ' a > > ,
41
- secret : P ,
41
+ secret : impl AsRef < [ u8 ] > ,
42
42
content_type : & str ,
43
43
aes_key : & Key ,
44
44
) -> Self {
Original file line number Diff line number Diff line change @@ -160,9 +160,9 @@ impl<'a> Item<'a> {
160
160
/// * `content_type` - The content type of the secret, usually something
161
161
/// like `text/plain`.
162
162
#[ doc( alias = "SetSecret" ) ]
163
- pub async fn set_secret < P : AsRef < [ u8 ] > > (
163
+ pub async fn set_secret (
164
164
& self ,
165
- secret : P ,
165
+ secret : impl AsRef < [ u8 ] > ,
166
166
content_type : & str ,
167
167
) -> Result < ( ) , Error > {
168
168
let secret = match self . algorithm {
Original file line number Diff line number Diff line change @@ -257,7 +257,7 @@ impl Item {
257
257
}
258
258
259
259
/// Sets a new secret.
260
- pub async fn set_secret < P : AsRef < [ u8 ] > > ( & self , secret : P ) -> Result < ( ) > {
260
+ pub async fn set_secret ( & self , secret : impl AsRef < [ u8 ] > ) -> Result < ( ) > {
261
261
match self {
262
262
Self :: File ( item, backend) => {
263
263
item. write ( ) . await . set_secret ( secret) ;
Original file line number Diff line number Diff line change @@ -74,9 +74,9 @@ impl Keyring {
74
74
}
75
75
76
76
/// Write to a keyring file
77
- pub async fn dump < P : AsRef < Path > > (
77
+ pub async fn dump (
78
78
& mut self ,
79
- path : P ,
79
+ path : impl AsRef < Path > ,
80
80
mtime : Option < std:: time:: SystemTime > ,
81
81
) -> Result < ( ) , Error > {
82
82
let tmp_path = if let Some ( parent) = path. as_ref ( ) . parent ( ) {
Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ impl Item {
84
84
}
85
85
86
86
/// Store a new secret.
87
- pub fn set_secret < P : AsRef < [ u8 ] > > ( & mut self , secret : P ) {
87
+ pub fn set_secret ( & mut self , secret : impl AsRef < [ u8 ] > ) {
88
88
self . modified = std:: time:: SystemTime :: UNIX_EPOCH
89
89
. elapsed ( )
90
90
. unwrap ( )
You can’t perform that action at this time.
0 commit comments