Skip to content

Commit 96060c2

Browse files
committed
chore: use nightly fmt
1 parent 2371922 commit 96060c2

File tree

301 files changed

+1937
-1525
lines changed

Some content is hidden

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

301 files changed

+1937
-1525
lines changed

core/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
- Introduce `rustfmt.toml`.
2+
See [PR](https://github.com/libp2p/rust-libp2p/pull/5686).
3+
14
## 0.42.1
25

36
- Added `libp2p::core::util::unreachable` that is a drop-in replacement of `void::unreachable`.

core/src/either.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,18 @@
1818
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1919
// DEALINGS IN THE SOFTWARE.
2020

21-
use crate::muxing::StreamMuxerEvent;
22-
use crate::transport::DialOpts;
2321
use crate::{
24-
muxing::StreamMuxer,
25-
transport::{ListenerId, Transport, TransportError, TransportEvent},
22+
muxing::{StreamMuxer, StreamMuxerEvent},
23+
transport::{DialOpts, ListenerId, Transport, TransportError, TransportEvent},
2624
Multiaddr,
2725
};
2826
use either::Either;
2927
use futures::prelude::*;
3028
use pin_project::pin_project;
31-
use std::{pin::Pin, task::Context, task::Poll};
29+
use std::{
30+
pin::Pin,
31+
task::{Context, Poll},
32+
};
3233

3334
impl<A, B> StreamMuxer for future::Either<A, B>
3435
where

core/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ mod proto {
3737
#![allow(unreachable_pub)]
3838
include!("generated/mod.rs");
3939
pub use self::{
40-
envelope_proto::*, peer_record_proto::mod_PeerRecord::*, peer_record_proto::PeerRecord,
40+
envelope_proto::*,
41+
peer_record_proto::{mod_PeerRecord::*, PeerRecord},
4142
};
4243
}
4344

core/src/muxing.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,14 @@
5050
//! The upgrade process will take ownership of the connection, which makes it possible for the
5151
//! implementation of `StreamMuxer` to control everything that happens on the wire.
5252
53-
use futures::{task::Context, task::Poll, AsyncRead, AsyncWrite};
53+
use futures::{
54+
task::{Context, Poll},
55+
AsyncRead, AsyncWrite,
56+
};
5457
use multiaddr::Multiaddr;
55-
use std::future::Future;
56-
use std::pin::Pin;
58+
use std::{future::Future, pin::Pin};
5759

58-
pub use self::boxed::StreamMuxerBox;
59-
pub use self::boxed::SubstreamBox;
60+
pub use self::boxed::{StreamMuxerBox, SubstreamBox};
6061

6162
mod boxed;
6263

core/src/muxing/boxed.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
use crate::muxing::{StreamMuxer, StreamMuxerEvent};
22
use futures::{AsyncRead, AsyncWrite};
33
use pin_project::pin_project;
4-
use std::error::Error;
5-
use std::fmt;
6-
use std::io;
7-
use std::io::{IoSlice, IoSliceMut};
8-
use std::pin::Pin;
9-
use std::task::{Context, Poll};
4+
use std::{
5+
error::Error,
6+
fmt, io,
7+
io::{IoSlice, IoSliceMut},
8+
pin::Pin,
9+
task::{Context, Poll},
10+
};
1011

1112
/// Abstract `StreamMuxer`.
1213
pub struct StreamMuxerBox {

core/src/peer_record.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
use crate::signed_envelope::SignedEnvelope;
2-
use crate::{proto, signed_envelope, DecodeError, Multiaddr};
3-
use libp2p_identity::Keypair;
4-
use libp2p_identity::PeerId;
5-
use libp2p_identity::SigningError;
1+
use crate::{proto, signed_envelope, signed_envelope::SignedEnvelope, DecodeError, Multiaddr};
2+
use libp2p_identity::{Keypair, PeerId, SigningError};
63
use quick_protobuf::{BytesReader, Writer};
74
use web_time::SystemTime;
85

core/src/signed_envelope.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use crate::{proto, DecodeError};
2-
use libp2p_identity::SigningError;
3-
use libp2p_identity::{Keypair, PublicKey};
2+
use libp2p_identity::{Keypair, PublicKey, SigningError};
43
use quick_protobuf::{BytesReader, Writer};
54
use std::fmt;
65
use unsigned_varint::encode::usize_buffer;

core/src/transport.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,10 @@ mod optional;
5050

5151
use crate::{ConnectedPoint, Endpoint};
5252

53-
pub use self::boxed::Boxed;
54-
pub use self::choice::OrTransport;
55-
pub use self::memory::MemoryTransport;
56-
pub use self::optional::OptionalTransport;
57-
pub use self::upgrade::Upgrade;
53+
pub use self::{
54+
boxed::Boxed, choice::OrTransport, memory::MemoryTransport, optional::OptionalTransport,
55+
upgrade::Upgrade,
56+
};
5857

5958
static NEXT_LISTENER_ID: AtomicUsize = AtomicUsize::new(1);
6059

core/src/transport/and_then.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@ use crate::{
2525
use either::Either;
2626
use futures::prelude::*;
2727
use multiaddr::Multiaddr;
28-
use std::{error, marker::PhantomPinned, pin::Pin, task::Context, task::Poll};
28+
use std::{
29+
error,
30+
marker::PhantomPinned,
31+
pin::Pin,
32+
task::{Context, Poll},
33+
};
2934

3035
/// See the [`Transport::and_then`] method.
3136
#[pin_project::pin_project]

core/src/transport/choice.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,17 @@
1818
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1919
// DEALINGS IN THE SOFTWARE.
2020

21-
use crate::either::EitherFuture;
22-
use crate::transport::{DialOpts, ListenerId, Transport, TransportError, TransportEvent};
21+
use crate::{
22+
either::EitherFuture,
23+
transport::{DialOpts, ListenerId, Transport, TransportError, TransportEvent},
24+
};
2325
use either::Either;
2426
use futures::future;
2527
use multiaddr::Multiaddr;
26-
use std::{pin::Pin, task::Context, task::Poll};
28+
use std::{
29+
pin::Pin,
30+
task::{Context, Poll},
31+
};
2732

2833
/// Struct returned by `or_transport()`.
2934
#[derive(Debug, Copy, Clone)]

0 commit comments

Comments
 (0)