File tree Expand file tree Collapse file tree 7 files changed +12
-13
lines changed Expand file tree Collapse file tree 7 files changed +12
-13
lines changed Original file line number Diff line number Diff line change @@ -216,7 +216,6 @@ missing_transmute_annotations = "deny"
216
216
mut_mut = " deny"
217
217
needless_bitwise_bool = " deny"
218
218
needless_character_iteration = " deny"
219
- needless_continue = " deny"
220
219
needless_for_each = " deny"
221
220
needless_maybe_sized = " deny"
222
221
needless_raw_string_hashes = " deny"
Original file line number Diff line number Diff line change @@ -348,7 +348,7 @@ fn get_window_start_and_end(
348
348
if window_len <= accounted_window {
349
349
( 0 , window_len)
350
350
} else {
351
- let start = ( window_len - ( accounted_window) + 1 ) / 2 ;
351
+ let start = ( window_len - ( accounted_window) ) . div_ceil ( 2 ) ;
352
352
( start, start + accounted_window)
353
353
}
354
354
}
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ impl CnSlowHashState {
49
49
& self . b
50
50
}
51
51
52
- fn get_keccak_bytes_mut ( & mut self ) -> & mut [ u8 ; KECCAK1600_BYTE_SIZE ] {
52
+ const fn get_keccak_bytes_mut ( & mut self ) -> & mut [ u8 ; KECCAK1600_BYTE_SIZE ] {
53
53
& mut self . b
54
54
}
55
55
Original file line number Diff line number Diff line change @@ -27,6 +27,10 @@ impl Error {
27
27
}
28
28
}
29
29
30
+ #[ expect(
31
+ clippy:: missing_const_for_fn,
32
+ reason = "False-positive, `<String as Deref>::deref` is not const"
33
+ ) ]
30
34
fn field_data ( & self ) -> & str {
31
35
match self {
32
36
Self :: IO ( data) | Self :: Format ( data) => data,
Original file line number Diff line number Diff line change @@ -194,23 +194,23 @@ impl<C: LevinCommand> BucketBuilder<C> {
194
194
}
195
195
}
196
196
197
- pub fn set_signature ( & mut self , sig : u64 ) {
197
+ pub const fn set_signature ( & mut self , sig : u64 ) {
198
198
self . signature = Some ( sig) ;
199
199
}
200
200
201
- pub fn set_message_type ( & mut self , ty : MessageType ) {
201
+ pub const fn set_message_type ( & mut self , ty : MessageType ) {
202
202
self . ty = Some ( ty) ;
203
203
}
204
204
205
205
pub fn set_command ( & mut self , command : C ) {
206
206
self . command = Some ( command) ;
207
207
}
208
208
209
- pub fn set_return_code ( & mut self , code : i32 ) {
209
+ pub const fn set_return_code ( & mut self , code : i32 ) {
210
210
self . return_code = Some ( code) ;
211
211
}
212
212
213
- pub fn set_protocol_version ( & mut self , version : u32 ) {
213
+ pub const fn set_protocol_version ( & mut self , version : u32 ) {
214
214
self . protocol_version = Some ( version) ;
215
215
}
216
216
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ impl<N: NetworkZone> WeakClient<N> {
45
45
/// Create a [`WeakBroadcastClient`] from this [`WeakClient`].
46
46
///
47
47
/// See the docs for [`WeakBroadcastClient`] for what this type can do.
48
- pub fn broadcast_client ( & mut self ) -> WeakBroadcastClient < ' _ , N > {
48
+ pub const fn broadcast_client ( & mut self ) -> WeakBroadcastClient < ' _ , N > {
49
49
WeakBroadcastClient ( self )
50
50
}
51
51
}
Original file line number Diff line number Diff line change 98
98
99
99
/// Connects to random seeds to get peers and immediately disconnects
100
100
#[ instrument( level = "info" , skip( self ) ) ]
101
- #[ expect(
102
- clippy:: significant_drop_in_scrutinee,
103
- clippy:: significant_drop_tightening
104
- ) ]
101
+ #[ expect( clippy:: significant_drop_tightening) ]
105
102
async fn connect_to_random_seeds ( & mut self ) -> Result < ( ) , OutboundConnectorError > {
106
103
let seeds = self
107
104
. config
@@ -161,7 +158,6 @@ where
161
158
162
159
tokio:: spawn (
163
160
async move {
164
- #[ expect( clippy:: significant_drop_in_scrutinee) ]
165
161
if let Ok ( Ok ( peer) ) = timeout ( HANDSHAKE_TIMEOUT , connection_fut) . await {
166
162
drop ( new_peers_tx. send ( peer) . await ) ;
167
163
}
You can’t perform that action at this time.
0 commit comments