Skip to content

Commit dfd3da2

Browse files
committed
cargo fmt
1 parent 68b1ede commit dfd3da2

File tree

6 files changed

+22
-16
lines changed

6 files changed

+22
-16
lines changed

benches/throughput.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use tokio::{
66
net::TcpStream,
77
};
88

9-
use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion, Throughput};
9+
use criterion::{BenchmarkId, Criterion, Throughput, criterion_group, criterion_main};
1010
criterion_group!(server_benches, bench_throughput);
1111
criterion_main!(server_benches);
1212
fn rt() -> tokio::runtime::Runtime {

examples/multi_stream.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use async_udx::{UdxSocket, UDX_DATA_MTU};
1+
use async_udx::{UDX_DATA_MTU, UdxSocket};
22
use std::time::Instant;
33
use tokio::io::{AsyncReadExt, AsyncWriteExt};
44

examples/rw.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::{future::Future, io};
44
use tokio::io::{AsyncReadExt, AsyncWriteExt};
55
use tokio::task::JoinHandle;
66

7-
use async_udx::{UdxSocket, UdxStream, UDX_DATA_MTU};
7+
use async_udx::{UDX_DATA_MTU, UdxSocket, UdxStream};
88

99
pub fn spawn<T>(name: impl ToString, future: T) -> JoinHandle<()>
1010
where

src/packet.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use atomic_instant::AtomicInstant;
22
use bytes::{BufMut, Bytes};
33
use std::fmt::{self, Debug};
4-
use std::sync::atomic::{AtomicBool, Ordering};
54
use std::sync::Arc;
5+
use std::sync::atomic::{AtomicBool, Ordering};
66
use std::{io, net::SocketAddr, sync::atomic::AtomicUsize};
77
use udx_udp::Transmit;
88

src/stream.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -548,9 +548,10 @@ impl UdxStreamInner {
548548
}
549549

550550
if (self.inflight + UDX_MTU) <= self.cwnd
551-
&& let Some(waker) = self.write_waker.take() {
552-
waker.wake();
553-
}
551+
&& let Some(waker) = self.write_waker.take()
552+
{
553+
waker.wake();
554+
}
554555

555556
// reset rto, since things are moving forward.
556557
self.rto_timeout
@@ -669,9 +670,10 @@ impl UdxStreamInner {
669670

670671
// packet is next in line, wake the read waker.
671672
if seq <= self.ack
672-
&& let Some(waker) = self.read_waker.take() {
673-
waker.wake();
674-
}
673+
&& let Some(waker) = self.read_waker.take()
674+
{
675+
waker.wake();
676+
}
675677
self.send_state_packet();
676678
}
677679

tests/stream.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,16 +138,20 @@ async fn test_halfopen_streams() -> io::Result<()> {
138138
bstr.write_all(b"BBB").await?;
139139

140140
// b_stream message not seen as socket message to a bc a_stream is half open
141-
assert!(tokio::time::timeout(Duration::from_millis(100), a.recv())
142-
.await
143-
.is_err());
141+
assert!(
142+
tokio::time::timeout(Duration::from_millis(100), a.recv())
143+
.await
144+
.is_err()
145+
);
144146

145147
let mut astr = a_half_str.connect(b.local_addr()?, bid)?;
146148
bstr.write_all(b"CCC").await?;
147149
// b_stream message not seen as socket message to a bc a_stream is open
148-
assert!(tokio::time::timeout(Duration::from_millis(100), a.recv())
149-
.await
150-
.is_err());
150+
assert!(
151+
tokio::time::timeout(Duration::from_millis(100), a.recv())
152+
.await
153+
.is_err()
154+
);
151155
let mut buf = vec![];
152156
astr.read_buf(&mut buf).await?;
153157
assert_eq!(&buf, b"AAABBBCCC");

0 commit comments

Comments
 (0)