Skip to content

Commit 6754299

Browse files
committed
make format
Signed-off-by: Connor1996 <[email protected]>
1 parent 928dd70 commit 6754299

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

src/engine.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ where
118118
) -> Result<Engine<F, FilePipeLog<F>>> {
119119
Engine::open_with(cfg, file_system, vec![])
120120
}
121-
121+
122122
fn open_with(
123123
mut cfg: Config,
124124
file_system: Arc<F>,

src/env/double_write.rs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ use std::path::PathBuf;
2121
use std::sync::atomic::AtomicU64;
2222
use std::sync::atomic::Ordering;
2323
use std::sync::Arc;
24-
use std::thread;
2524
use std::sync::Mutex;
25+
use std::thread;
2626

2727
use crate::env::default::LogFd;
2828
use crate::env::DefaultFileSystem;
@@ -93,8 +93,8 @@ fn replace_path(path: &Path, from: &Path, to: &Path) -> PathBuf {
9393
}
9494
}
9595

96-
97-
// Make sure the task is sent to two disks' channel atomically, otherwise the ordering of the tasks in two disks are not same.
96+
// Make sure the task is sent to two disks' channel atomically, otherwise the
97+
// ordering of the tasks in two disks are not same.
9898
#[derive(Clone)]
9999
struct HedgedSender(Arc<Mutex<HedgedSenderInner>>);
100100

@@ -104,7 +104,10 @@ struct HedgedSenderInner {
104104
}
105105

106106
impl HedgedSender {
107-
fn new(disk1: Sender<(Task, Callback<TaskRes>)>, disk2: Sender<(Task, Callback<TaskRes>)>) -> Self {
107+
fn new(
108+
disk1: Sender<(Task, Callback<TaskRes>)>,
109+
disk2: Sender<(Task, Callback<TaskRes>)>,
110+
) -> Self {
108111
Self(Arc::new(Mutex::new(HedgedSenderInner { disk1, disk2 })))
109112
}
110113

@@ -380,7 +383,7 @@ impl HedgedFileSystem {
380383
async fn wait_one(&self, task1: Task, task2: Task) -> IoResult<()> {
381384
let (cb1, mut f1) = paired_future_callback();
382385
let (cb2, mut f2) = paired_future_callback();
383-
self.sender.send(task1, task2, cb1, cb2) ;
386+
self.sender.send(task1, task2, cb1, cb2);
384387

385388
select! {
386389
res1 = f1 => res1.unwrap().map(|_| ()),
@@ -425,7 +428,8 @@ impl HedgedFileSystem {
425428

426429
impl Drop for HedgedFileSystem {
427430
fn drop(&mut self) {
428-
self.sender.send(Task::Stop, Task::Stop, Box::new(|_| {}), Box::new(|_| {}));
431+
self.sender
432+
.send(Task::Stop, Task::Stop, Box::new(|_| {}), Box::new(|_| {}));
429433
self.handle1.take().unwrap().join().unwrap();
430434
self.handle2.take().unwrap().join().unwrap();
431435
}
@@ -692,7 +696,7 @@ impl HedgedHandle {
692696
async fn wait_one(&self, task1: Task, task2: Task) -> IoResult<TaskRes> {
693697
let (cb1, mut f1) = paired_future_callback();
694698
let (cb2, mut f2) = paired_future_callback();
695-
self.sender.send(task1, task2, cb1, cb2) ;
699+
self.sender.send(task1, task2, cb1, cb2);
696700

697701
select! {
698702
res1 = f1 => res1.unwrap(),

0 commit comments

Comments
 (0)