Skip to content

Commit 404a622

Browse files
authored
chore: address clippy lints and bump ci clippy stable
superseeds #5248, sorry @drHuangMHT only saw yours now, can you review this one? https://github.com/libp2p/rust-libp2p/actions/runs/8377129630/job/22938498078?pr=5253#step:6:843 is a bug, see [here](rust-lang/rust-clippy#12377) Thanks! Pull-Request: #5253.
1 parent a579e69 commit 404a622

File tree

73 files changed

+111
-292
lines changed

Some content is hidden

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

73 files changed

+111
-292
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
- name: Extract version from manifest
6565
run: |
6666
CRATE_VERSION=$(cargo metadata --format-version=1 --no-deps | jq -e -r '.packages[] | select(.name == "'"$CRATE"'") | .version')
67-
67+
6868
echo "CRATE_VERSION=$CRATE_VERSION" >> $GITHUB_ENV
6969
7070
- name: Enforce version in `workspace.dependencies` matches latest version
@@ -234,7 +234,7 @@ jobs:
234234
fail-fast: false
235235
matrix:
236236
rust-version: [
237-
1.75.0, # current stable
237+
1.77.0, # current stable
238238
beta,
239239
]
240240
steps:

core/src/peer_record.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use libp2p_identity::Keypair;
55
use libp2p_identity::PeerId;
66
use libp2p_identity::SigningError;
77
use quick_protobuf::{BytesReader, Writer};
8-
use std::convert::TryInto;
98

109
const PAYLOAD_TYPE: &str = "/libp2p/routing-state-record";
1110
const DOMAIN_SEP: &str = "libp2p-routing-state";

core/src/translation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ mod tests {
6565
expected: Multiaddr,
6666
}
6767

68-
let tests = vec![
68+
let tests = [
6969
// Basic ipv4.
7070
Test {
7171
original: "/ip4/192.0.2.1/tcp/1".parse().unwrap(),

core/src/transport/memory.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,7 @@
2020

2121
use crate::transport::{ListenerId, Transport, TransportError, TransportEvent};
2222
use fnv::FnvHashMap;
23-
use futures::{
24-
channel::mpsc,
25-
future::{self, Ready},
26-
prelude::*,
27-
task::Context,
28-
task::Poll,
29-
};
23+
use futures::{channel::mpsc, future::Ready, prelude::*, task::Context, task::Poll};
3024
use multiaddr::{Multiaddr, Protocol};
3125
use once_cell::sync::Lazy;
3226
use parking_lot::Mutex;

core/src/upgrade/apply.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
use crate::upgrade::{InboundConnectionUpgrade, OutboundConnectionUpgrade, UpgradeError};
2222
use crate::{connection::ConnectedPoint, Negotiated};
2323
use futures::{future::Either, prelude::*};
24-
use multistream_select::{self, DialerSelectFuture, ListenerSelectFuture};
24+
use multistream_select::{DialerSelectFuture, ListenerSelectFuture};
2525
use std::{mem, pin::Pin, task::Context, task::Poll};
2626

2727
pub(crate) use multistream_select::Version;

examples/autonat/src/bin/autonat_client.rs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -110,22 +110,3 @@ impl Behaviour {
110110
}
111111
}
112112
}
113-
114-
#[derive(Debug)]
115-
#[allow(clippy::large_enum_variant)]
116-
enum Event {
117-
AutoNat(autonat::Event),
118-
Identify(identify::Event),
119-
}
120-
121-
impl From<identify::Event> for Event {
122-
fn from(v: identify::Event) -> Self {
123-
Self::Identify(v)
124-
}
125-
}
126-
127-
impl From<autonat::Event> for Event {
128-
fn from(v: autonat::Event) -> Self {
129-
Self::AutoNat(v)
130-
}
131-
}

examples/autonat/src/bin/autonat_server.rs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -94,22 +94,3 @@ impl Behaviour {
9494
}
9595
}
9696
}
97-
98-
#[derive(Debug)]
99-
#[allow(clippy::large_enum_variant)]
100-
enum Event {
101-
AutoNat(autonat::Event),
102-
Identify(identify::Event),
103-
}
104-
105-
impl From<identify::Event> for Event {
106-
fn from(v: identify::Event) -> Self {
107-
Self::Identify(v)
108-
}
109-
}
110-
111-
impl From<autonat::Event> for Event {
112-
fn from(v: autonat::Event) -> Self {
113-
Self::AutoNat(v)
114-
}
115-
}

identity/src/ed25519.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ use core::cmp;
2525
use core::fmt;
2626
use core::hash;
2727
use ed25519_dalek::{self as ed25519, Signer as _, Verifier as _};
28-
use std::convert::TryFrom;
2928
use zeroize::Zeroize;
3029

3130
/// An Ed25519 keypair.

identity/src/keypair.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,32 +24,30 @@
2424
feature = "ed25519",
2525
feature = "rsa"
2626
))]
27-
use crate::error::OtherVariantError;
28-
use crate::error::{DecodingError, SigningError};
27+
#[cfg(feature = "ed25519")]
28+
use crate::ed25519;
2929
#[cfg(any(
3030
feature = "ecdsa",
3131
feature = "secp256k1",
3232
feature = "ed25519",
3333
feature = "rsa"
3434
))]
35-
use crate::proto;
35+
use crate::error::OtherVariantError;
36+
use crate::error::{DecodingError, SigningError};
3637
#[cfg(any(
3738
feature = "ecdsa",
3839
feature = "secp256k1",
3940
feature = "ed25519",
4041
feature = "rsa"
4142
))]
42-
use quick_protobuf::{BytesReader, Writer};
43+
use crate::proto;
4344
#[cfg(any(
4445
feature = "ecdsa",
4546
feature = "secp256k1",
4647
feature = "ed25519",
4748
feature = "rsa"
4849
))]
49-
use std::convert::TryFrom;
50-
51-
#[cfg(feature = "ed25519")]
52-
use crate::ed25519;
50+
use quick_protobuf::{BytesReader, Writer};
5351

5452
#[cfg(all(feature = "rsa", not(target_arch = "wasm32")))]
5553
use crate::rsa;

identity/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,14 @@
3434
//! All key types have functions to enable conversion to/from their binary representations.
3535
3636
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
37-
37+
#![allow(unreachable_pub)]
3838
#[cfg(any(
3939
feature = "ecdsa",
4040
feature = "secp256k1",
4141
feature = "ed25519",
4242
feature = "rsa"
4343
))]
4444
mod proto {
45-
#![allow(unreachable_pub)]
4645
include!("generated/mod.rs");
4746
pub(crate) use self::keys_proto::*;
4847
}

0 commit comments

Comments
 (0)