File tree Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -7,10 +7,10 @@ use std::collections::hash_map::{DefaultHasher, HashMap};
7
7
use std:: fs;
8
8
use std:: hash:: { Hash , Hasher } ;
9
9
use std:: io:: { Read , Write } ;
10
- use std:: path:: { Path , PathBuf } ;
11
- use std:: sync:: { Arc , Mutex } ;
12
10
#[ cfg( unix) ]
13
11
use std:: os:: unix:: fs:: OpenOptionsExt ;
12
+ use std:: path:: { Path , PathBuf } ;
13
+ use std:: sync:: { Arc , Mutex } ;
14
14
15
15
use crate :: { Error , Result } ;
16
16
@@ -147,15 +147,14 @@ impl Persist for FilePersist {
147
147
fn put ( & self , key : & PersistKey , value : & [ u8 ] ) -> Result < ( ) > {
148
148
let f_name = file_name_of ( & self . dir , key) ;
149
149
match key. kind {
150
- PersistKind :: AccountPrivateKey | PersistKind :: PrivateKey =>
151
- fs:: OpenOptions :: new ( )
152
- . mode ( 0o600 )
153
- . write ( true )
154
- . truncate ( true )
155
- . create ( true )
156
- . open ( f_name) ?
157
- . write_all ( value)
158
- . map_err ( Error :: from) ,
150
+ PersistKind :: AccountPrivateKey | PersistKind :: PrivateKey => fs:: OpenOptions :: new ( )
151
+ . mode ( 0o600 )
152
+ . write ( true )
153
+ . truncate ( true )
154
+ . create ( true )
155
+ . open ( f_name) ?
156
+ . write_all ( value)
157
+ . map_err ( Error :: from) ,
159
158
PersistKind :: Certificate => fs:: write ( f_name, value) . map_err ( Error :: from) ,
160
159
}
161
160
}
You can’t perform that action at this time.
0 commit comments