Skip to content

Commit 4e7ff3e

Browse files
jxsdariusc93
andauthored
chore(ci): address clippy beta lints (#5649)
Co-authored-by: Darius Clark <[email protected]>
1 parent c7e8129 commit 4e7ff3e

File tree

17 files changed

+29
-36
lines changed

17 files changed

+29
-36
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

identity/src/peer_id.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ impl<'de> Deserialize<'de> for PeerId {
191191

192192
struct PeerIdVisitor;
193193

194-
impl<'de> Visitor<'de> for PeerIdVisitor {
194+
impl Visitor<'_> for PeerIdVisitor {
195195
type Value = PeerId;
196196

197197
fn expecting(&self, f: &mut fmt::Formatter) -> fmt::Result {

identity/src/rsa.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ struct Asn1RawOid<'a> {
149149
object: DerObject<'a>,
150150
}
151151

152-
impl<'a> Asn1RawOid<'a> {
152+
impl Asn1RawOid<'_> {
153153
/// The underlying OID as byte literal.
154154
pub(crate) fn oid(&self) -> &[u8] {
155155
self.object.value()
@@ -169,7 +169,7 @@ impl<'a> DerTypeView<'a> for Asn1RawOid<'a> {
169169
}
170170
}
171171

172-
impl<'a> DerEncodable for Asn1RawOid<'a> {
172+
impl DerEncodable for Asn1RawOid<'_> {
173173
fn encode<S: Sink>(&self, sink: &mut S) -> Result<(), Asn1DerError> {
174174
self.object.encode(sink)
175175
}

misc/quick-protobuf-codec/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ impl<'a> BytesMutWriterBackend<'a> {
120120
}
121121
}
122122

123-
impl<'a> WriterBackend for BytesMutWriterBackend<'a> {
123+
impl WriterBackend for BytesMutWriterBackend<'_> {
124124
fn pb_write_u8(&mut self, x: u8) -> quick_protobuf::Result<()> {
125125
self.dst.put_u8(x);
126126

muxers/test-harness/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ enum Event {
206206
ProtocolComplete,
207207
}
208208

209-
impl<'m, M> Stream for Harness<'m, M>
209+
impl<M> Stream for Harness<'_, M>
210210
where
211211
M: StreamMuxer + Unpin,
212212
{

protocols/autonat/src/v1/behaviour/as_client.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ pub(crate) struct AsClient<'a> {
9898
pub(crate) other_candidates: &'a HashSet<Multiaddr>,
9999
}
100100

101-
impl<'a> HandleInnerEvent for AsClient<'a> {
101+
impl HandleInnerEvent for AsClient<'_> {
102102
fn handle_event(
103103
&mut self,
104104
event: request_response::Event<DialRequest, DialResponse>,
@@ -179,7 +179,7 @@ impl<'a> HandleInnerEvent for AsClient<'a> {
179179
}
180180
}
181181

182-
impl<'a> AsClient<'a> {
182+
impl AsClient<'_> {
183183
pub(crate) fn poll_auto_probe(&mut self, cx: &mut Context<'_>) -> Poll<OutboundProbeEvent> {
184184
match self.schedule_probe.poll_unpin(cx) {
185185
Poll::Ready(()) => {

protocols/autonat/src/v1/behaviour/as_server.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ pub(crate) struct AsServer<'a> {
9191
>,
9292
}
9393

94-
impl<'a> HandleInnerEvent for AsServer<'a> {
94+
impl HandleInnerEvent for AsServer<'_> {
9595
fn handle_event(
9696
&mut self,
9797
event: request_response::Event<DialRequest, DialResponse>,
@@ -208,7 +208,7 @@ impl<'a> HandleInnerEvent for AsServer<'a> {
208208
}
209209
}
210210

211-
impl<'a> AsServer<'a> {
211+
impl AsServer<'_> {
212212
pub(crate) fn on_outbound_connection(
213213
&mut self,
214214
peer: &PeerId,

protocols/gossipsub/src/backoff.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ pub(crate) struct BackoffStorage {
4848

4949
impl BackoffStorage {
5050
fn heartbeats(d: &Duration, heartbeat_interval: &Duration) -> usize {
51-
((d.as_nanos() + heartbeat_interval.as_nanos() - 1) / heartbeat_interval.as_nanos())
52-
as usize
51+
d.as_nanos().div_ceil(heartbeat_interval.as_nanos()) as usize
5352
}
5453

5554
pub(crate) fn new(

protocols/kad/src/behaviour.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3361,7 +3361,7 @@ pub struct QueryMut<'a> {
33613361
query: &'a mut Query,
33623362
}
33633363

3364-
impl<'a> QueryMut<'a> {
3364+
impl QueryMut<'_> {
33653365
pub fn id(&self) -> QueryId {
33663366
self.query.id()
33673367
}
@@ -3391,7 +3391,7 @@ pub struct QueryRef<'a> {
33913391
query: &'a Query,
33923392
}
33933393

3394-
impl<'a> QueryRef<'a> {
3394+
impl QueryRef<'_> {
33953395
pub fn id(&self) -> QueryId {
33963396
self.query.id()
33973397
}

protocols/ping/src/protocol.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ pub const PROTOCOL_NAME: StreamProtocol = StreamProtocol::new("/ipfs/ping/1.0.0"
4444
/// > Nagle's algorithm, delayed acks and similar configuration options
4545
/// > which can affect latencies especially on otherwise low-volume
4646
/// > connections.
47-
4847
const PING_SIZE: usize = 32;
4948

5049
/// Sends a ping and waits for the pong.

0 commit comments

Comments
 (0)