Skip to content

Commit 4e77366

Browse files
committed
fmt: cargo fmt
1 parent 6af3ff8 commit 4e77366

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

examples/src/std_threads.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use fq;
21
use anyhow::Error;
2+
use fq;
33

44
fn main() -> Result<(), Error> {
55
const COUNT: usize = 1_000_000;
@@ -9,8 +9,7 @@ fn main() -> Result<(), Error> {
99

1010
let sender = std::thread::spawn(move || {
1111
for i in 0..COUNT {
12-
producer.push(i)
13-
.expect("Unable to send to queue");
12+
producer.push(i).expect("Unable to send to queue");
1413
}
1514
println!("Sent {COUNT} messages in {:?}", instant.elapsed());
1615
});
@@ -35,7 +34,11 @@ fn main() -> Result<(), Error> {
3534
receiver.join().unwrap();
3635

3736
let elapsed = instant.elapsed();
38-
println!("Completed in {:?}, average message latency: {:?}", elapsed, elapsed / COUNT as u32);
37+
println!(
38+
"Completed in {:?}, average message latency: {:?}",
39+
elapsed,
40+
elapsed / COUNT as u32
41+
);
3942

4043
Ok(())
4144
}

examples/src/tokio_threads.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
use anyhow::Error;
12
use fq;
23
use tokio;
3-
use anyhow::Error;
44

55
#[tokio::main]
66
async fn main() -> Result<(), Error> {
@@ -11,8 +11,7 @@ async fn main() -> Result<(), Error> {
1111

1212
let sender = tokio::spawn(async move {
1313
for i in 0..COUNT {
14-
producer.push(i)
15-
.expect("Unable to send to queue");
14+
producer.push(i).expect("Unable to send to queue");
1615
}
1716
println!("Sent {COUNT} messages in {:?}", instant.elapsed());
1817
});
@@ -36,7 +35,11 @@ async fn main() -> Result<(), Error> {
3635
tokio::join!(sender, receiver);
3736

3837
let elapsed = instant.elapsed();
39-
println!("Completed in {:?}, average message latency: {:?}", elapsed, elapsed / COUNT as u32);
38+
println!(
39+
"Completed in {:?}, average message latency: {:?}",
40+
elapsed,
41+
elapsed / COUNT as u32
42+
);
4043

4144
Ok(())
4245
}

0 commit comments

Comments
 (0)