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"
216216mut_mut = " deny"
217217needless_bitwise_bool = " deny"
218218needless_character_iteration = " deny"
219- needless_continue = " deny"
220219needless_for_each = " deny"
221220needless_maybe_sized = " deny"
222221needless_raw_string_hashes = " deny"
Original file line number Diff line number Diff line change @@ -348,7 +348,7 @@ fn get_window_start_and_end(
348348 if window_len <= accounted_window {
349349 ( 0 , window_len)
350350 } else {
351- let start = ( window_len - ( accounted_window) + 1 ) / 2 ;
351+ let start = ( window_len - ( accounted_window) ) . div_ceil ( 2 ) ;
352352 ( start, start + accounted_window)
353353 }
354354}
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ impl CnSlowHashState {
4949 & self . b
5050 }
5151
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 ] {
5353 & mut self . b
5454 }
5555
Original file line number Diff line number Diff line change @@ -27,6 +27,10 @@ impl Error {
2727 }
2828 }
2929
30+ #[ expect(
31+ clippy:: missing_const_for_fn,
32+ reason = "False-positive, `<String as Deref>::deref` is not const"
33+ ) ]
3034 fn field_data ( & self ) -> & str {
3135 match self {
3236 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> {
194194 }
195195 }
196196
197- pub fn set_signature ( & mut self , sig : u64 ) {
197+ pub const fn set_signature ( & mut self , sig : u64 ) {
198198 self . signature = Some ( sig) ;
199199 }
200200
201- pub fn set_message_type ( & mut self , ty : MessageType ) {
201+ pub const fn set_message_type ( & mut self , ty : MessageType ) {
202202 self . ty = Some ( ty) ;
203203 }
204204
205205 pub fn set_command ( & mut self , command : C ) {
206206 self . command = Some ( command) ;
207207 }
208208
209- pub fn set_return_code ( & mut self , code : i32 ) {
209+ pub const fn set_return_code ( & mut self , code : i32 ) {
210210 self . return_code = Some ( code) ;
211211 }
212212
213- pub fn set_protocol_version ( & mut self , version : u32 ) {
213+ pub const fn set_protocol_version ( & mut self , version : u32 ) {
214214 self . protocol_version = Some ( version) ;
215215 }
216216
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ impl<N: NetworkZone> WeakClient<N> {
4545 /// Create a [`WeakBroadcastClient`] from this [`WeakClient`].
4646 ///
4747 /// 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 > {
4949 WeakBroadcastClient ( self )
5050 }
5151}
Original file line number Diff line number Diff line change 9898
9999 /// Connects to random seeds to get peers and immediately disconnects
100100 #[ 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) ]
105102 async fn connect_to_random_seeds ( & mut self ) -> Result < ( ) , OutboundConnectorError > {
106103 let seeds = self
107104 . config
@@ -161,7 +158,6 @@ where
161158
162159 tokio:: spawn (
163160 async move {
164- #[ expect( clippy:: significant_drop_in_scrutinee) ]
165161 if let Ok ( Ok ( peer) ) = timeout ( HANDSHAKE_TIMEOUT , connection_fut) . await {
166162 drop ( new_peers_tx. send ( peer) . await ) ;
167163 }
You can’t perform that action at this time.
0 commit comments