Skip to content

Commit dd14855

Browse files
authored
workspace: Rust 1.88..=1.90 (#553)
* clippy --fix * add lints * remove expect
1 parent 267c98b commit dd14855

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,8 @@ precedence_bits = "deny"
365365
as_pointer_underscore = "deny"
366366
literal_string_with_formatting_args = "deny"
367367
manual_midpoint = "deny"
368+
ip_constant = "deny"
369+
doc_broken_link = "deny"
368370

369371
# Warm
370372
cast_possible_truncation = "deny"

consensus/rules/src/blocks.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ pub trait RandomX {
5353

5454
/// Returns if this height is a RandomX seed height.
5555
pub const fn is_randomx_seed_height(height: usize) -> bool {
56-
height % RX_SEEDHASH_EPOCH_BLOCKS == 0
56+
height.is_multiple_of(RX_SEEDHASH_EPOCH_BLOCKS)
5757
}
5858

5959
/// Returns the RandomX seed height for this block.

storage/blockchain/src/ops/alt_block/block.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@ mod tests {
228228
types::AltBlockHeight,
229229
};
230230

231-
#[expect(clippy::range_plus_one)]
232231
#[test]
233232
fn all_alt_blocks() {
234233
let (env, _tmp) = tmp_concrete_env();

types/fixed-bytes/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ impl<const N: usize> TryFrom<Bytes> for ByteArrayVec<N> {
192192
type Error = FixedByteError;
193193

194194
fn try_from(value: Bytes) -> Result<Self, Self::Error> {
195-
if value.len() % N != 0 {
195+
if !value.len().is_multiple_of(N) {
196196
return Err(FixedByteError::InvalidLength);
197197
}
198198

@@ -222,7 +222,7 @@ impl<const N: usize> TryFrom<Vec<u8>> for ByteArrayVec<N> {
222222
type Error = FixedByteError;
223223

224224
fn try_from(value: Vec<u8>) -> Result<Self, Self::Error> {
225-
if value.len() % N != 0 {
225+
if !value.len().is_multiple_of(N) {
226226
return Err(FixedByteError::InvalidLength);
227227
}
228228

0 commit comments

Comments
 (0)