Skip to content

Commit 4693f4a

Browse files
committed
Execute cargo fmt --all
1 parent 2abd6c7 commit 4693f4a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+199
-219
lines changed

bench/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ impl Bench {
6868
self.cycles,
6969
total,
7070
total / self.cycles,
71-
self.executed_time_list[(self.cycles/2) as usize],
71+
self.executed_time_list[(self.cycles / 2) as usize],
7272
self.executed_time_list[self.cycles as usize - 1],
7373
self.executed_time_list[0]
7474
)

bench/src/main.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use bench::Bench;
22
use bytes::Bytes;
33
use futures::channel;
44
use p2p::{
5-
async_trait,
5+
ProtocolId, async_trait,
66
builder::{MetaBuilder, ServiceBuilder},
77
context::{ProtocolContext, ProtocolContextMutRef},
88
multiaddr::Multiaddr,
@@ -11,7 +11,6 @@ use p2p::{
1111
ProtocolHandle, ProtocolMeta, Service, ServiceControl, TargetProtocol, TargetSession,
1212
},
1313
traits::{ServiceHandle, ServiceProtocol},
14-
ProtocolId,
1514
};
1615
use std::{
1716
sync::{Once, OnceLock},

multiaddr/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ pub use self::onion_addr::Onion3Addr;
88
pub use self::protocol::Protocol;
99
use bytes::{Bytes, BytesMut};
1010
use serde::{
11-
de::{self, Error as DeserializerError},
1211
Deserialize, Deserializer, Serialize, Serializer,
12+
de::{self, Error as DeserializerError},
1313
};
1414
use std::{
1515
fmt,

multiaddr/src/protocol.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use std::{
1010
str::{self, FromStr},
1111
};
1212

13-
use crate::{error::Error, Onion3Addr};
13+
use crate::{Onion3Addr, error::Error};
1414

1515
const DNS4: u32 = 0x36;
1616
const DNS6: u32 = 0x37;

secio/benches/bench.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use criterion::{criterion_group, criterion_main, Bencher, Criterion};
2-
use tentacle_secio::crypto::{cipher::CipherType, new_stream, CryptoMode};
1+
use criterion::{Bencher, Criterion, criterion_group, criterion_main};
2+
use tentacle_secio::crypto::{CryptoMode, cipher::CipherType, new_stream};
33

44
fn decode_encode(data: &[u8], cipher: CipherType) {
55
let cipher_key = (0..cipher.key_size())

secio/examples/secio_simple.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use bytes::BytesMut;
22
use log::info;
3-
use tentacle_secio::{handshake::Config, SecioKeyPair};
3+
use tentacle_secio::{SecioKeyPair, handshake::Config};
44
use tokio::{
55
io::{AsyncReadExt, AsyncWriteExt},
66
net::{TcpListener, TcpStream},

secio/src/codec/secure_stream.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use bytes::{Buf, Bytes, BytesMut};
22
use futures::{SinkExt, StreamExt};
33
use log::{debug, trace};
44
use tokio::io::{AsyncRead, AsyncReadExt, AsyncWrite, ReadBuf};
5-
use tokio_util::codec::{length_delimited::LengthDelimitedCodec, Framed};
5+
use tokio_util::codec::{Framed, length_delimited::LengthDelimitedCodec};
66

77
use std::{
88
cmp::min,
@@ -231,14 +231,14 @@ where
231231
#[cfg(test)]
232232
mod tests {
233233
use super::SecureStream;
234-
use crate::crypto::{cipher::CipherType, new_stream, CryptoMode};
234+
use crate::crypto::{CryptoMode, cipher::CipherType, new_stream};
235235
use bytes::BytesMut;
236236
use futures::channel;
237237
use tokio::{
238238
io::{AsyncReadExt, AsyncWriteExt},
239239
net::{TcpListener, TcpStream},
240240
};
241-
use tokio_util::codec::{length_delimited::LengthDelimitedCodec, Framed};
241+
use tokio_util::codec::{Framed, length_delimited::LengthDelimitedCodec};
242242

243243
fn rt() -> &'static tokio::runtime::Runtime {
244244
static RT: std::sync::OnceLock<tokio::runtime::Runtime> = std::sync::OnceLock::new();

secio/src/crypto/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ fn nonce_advance(nonce: &mut [u8]) {
100100
#[cfg(all(test, unix))]
101101
mod test {
102102
use super::{
103-
cipher::CipherType, openssl_impl::OpenSsLCrypt, ring_impl::RingAeadCipher,
104-
wasm_compat::WasmCrypt, CryptoMode,
103+
CryptoMode, cipher::CipherType, openssl_impl::OpenSsLCrypt, ring_impl::RingAeadCipher,
104+
wasm_compat::WasmCrypt,
105105
};
106106
use proptest::prelude::*;
107107

secio/src/crypto/openssl_impl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use bytes::{Bytes, BytesMut};
22
use openssl::symm;
33

44
use crate::{
5-
crypto::{cipher::CipherType, nonce_advance, StreamCipher},
5+
crypto::{StreamCipher, cipher::CipherType, nonce_advance},
66
error::SecioError,
77
};
88

secio/src/crypto/ring_impl.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
use bytes::BytesMut;
22
use ring::{
33
aead::{
4-
Aad, BoundKey, Nonce, NonceSequence, OpeningKey, SealingKey, UnboundKey, AES_128_GCM,
5-
AES_256_GCM, CHACHA20_POLY1305,
4+
AES_128_GCM, AES_256_GCM, Aad, BoundKey, CHACHA20_POLY1305, Nonce, NonceSequence,
5+
OpeningKey, SealingKey, UnboundKey,
66
},
77
error::Unspecified,
88
};
99

1010
use std::ptr;
1111

1212
use crate::{
13-
crypto::{cipher::CipherType, nonce_advance, CryptoMode, StreamCipher},
13+
crypto::{CryptoMode, StreamCipher, cipher::CipherType, nonce_advance},
1414
error::SecioError,
1515
};
1616

0 commit comments

Comments
 (0)