Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ missing_transmute_annotations = "deny"
mut_mut = "deny"
needless_bitwise_bool = "deny"
needless_character_iteration = "deny"
needless_continue = "deny"
needless_for_each = "deny"
needless_maybe_sized = "deny"
needless_raw_string_hashes = "deny"
Expand Down
2 changes: 1 addition & 1 deletion consensus/context/src/difficulty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ fn get_window_start_and_end(
if window_len <= accounted_window {
(0, window_len)
} else {
let start = (window_len - (accounted_window) + 1) / 2;
let start = (window_len - (accounted_window)).div_ceil(2);
(start, start + accounted_window)
}
}
Expand Down
2 changes: 1 addition & 1 deletion cryptonight/src/slow_hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl CnSlowHashState {
&self.b
}

fn get_keccak_bytes_mut(&mut self) -> &mut [u8; KECCAK1600_BYTE_SIZE] {
const fn get_keccak_bytes_mut(&mut self) -> &mut [u8; KECCAK1600_BYTE_SIZE] {
&mut self.b
}

Expand Down
4 changes: 4 additions & 0 deletions net/epee-encoding/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ impl Error {
}
}

#[expect(
clippy::missing_const_for_fn,
reason = "False-positive, `<String as Deref>::deref` is not const"
)]
fn field_data(&self) -> &str {
match self {
Self::IO(data) | Self::Format(data) => data,
Expand Down
8 changes: 4 additions & 4 deletions net/levin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,23 +194,23 @@ impl<C: LevinCommand> BucketBuilder<C> {
}
}

pub fn set_signature(&mut self, sig: u64) {
pub const fn set_signature(&mut self, sig: u64) {
self.signature = Some(sig);
}

pub fn set_message_type(&mut self, ty: MessageType) {
pub const fn set_message_type(&mut self, ty: MessageType) {
self.ty = Some(ty);
}

pub fn set_command(&mut self, command: C) {
self.command = Some(command);
}

pub fn set_return_code(&mut self, code: i32) {
pub const fn set_return_code(&mut self, code: i32) {
self.return_code = Some(code);
}

pub fn set_protocol_version(&mut self, version: u32) {
pub const fn set_protocol_version(&mut self, version: u32) {
self.protocol_version = Some(version);
}

Expand Down
2 changes: 1 addition & 1 deletion p2p/p2p-core/src/client/weak.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl<N: NetworkZone> WeakClient<N> {
/// Create a [`WeakBroadcastClient`] from this [`WeakClient`].
///
/// See the docs for [`WeakBroadcastClient`] for what this type can do.
pub fn broadcast_client(&mut self) -> WeakBroadcastClient<'_, N> {
pub const fn broadcast_client(&mut self) -> WeakBroadcastClient<'_, N> {
WeakBroadcastClient(self)
}
}
Expand Down
6 changes: 1 addition & 5 deletions p2p/p2p/src/connection_maintainer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,7 @@ where

/// Connects to random seeds to get peers and immediately disconnects
#[instrument(level = "info", skip(self))]
#[expect(
clippy::significant_drop_in_scrutinee,
clippy::significant_drop_tightening
)]
#[expect(clippy::significant_drop_tightening)]
async fn connect_to_random_seeds(&mut self) -> Result<(), OutboundConnectorError> {
let seeds = self
.config
Expand Down Expand Up @@ -161,7 +158,6 @@ where

tokio::spawn(
async move {
#[expect(clippy::significant_drop_in_scrutinee)]
if let Ok(Ok(peer)) = timeout(HANDSHAKE_TIMEOUT, connection_fut).await {
drop(new_peers_tx.send(peer).await);
}
Expand Down