Skip to content

Commit 9d4702c

Browse files
committed
cargo fmt
1 parent d00f048 commit 9d4702c

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

src/persist.rs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ use std::collections::hash_map::{DefaultHasher, HashMap};
77
use std::fs;
88
use std::hash::{Hash, Hasher};
99
use std::io::{Read, Write};
10-
use std::path::{Path, PathBuf};
11-
use std::sync::{Arc, Mutex};
1210
#[cfg(unix)]
1311
use std::os::unix::fs::OpenOptionsExt;
12+
use std::path::{Path, PathBuf};
13+
use std::sync::{Arc, Mutex};
1414

1515
use crate::{Error, Result};
1616

@@ -147,15 +147,14 @@ impl Persist for FilePersist {
147147
fn put(&self, key: &PersistKey, value: &[u8]) -> Result<()> {
148148
let f_name = file_name_of(&self.dir, key);
149149
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),
159158
PersistKind::Certificate => fs::write(f_name, value).map_err(Error::from),
160159
}
161160
}

0 commit comments

Comments
 (0)