Skip to content

Commit c6fbcfd

Browse files
committed
fix: resolve clippy failures blocking PR matrix-construct#366
1 parent 427859c commit c6fbcfd

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

src/core/utils/sys/storage.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,7 @@ pub fn name_from_path(path: &Path) -> Result<String> {
179179
}
180180

181181
/// Get the (major, minor) of the block device on which Path is mounted.
182-
#[expect(
183-
clippy::useless_conversion,
184-
clippy::unnecessary_fallible_conversions
185-
)]
182+
#[expect(clippy::useless_conversion)]
186183
fn dev_from_path(path: &Path) -> Result<(dev_t, dev_t)> {
187184
#[cfg(target_family = "unix")]
188185
use std::os::unix::fs::MetadataExt;

src/database/engine/replication.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -346,22 +346,22 @@ mod tests {
346346
// Corrupt one byte in the batch_data region (after the 33-byte header).
347347
let last = encoded.len() - 1;
348348
encoded[last] ^= 0xFF;
349-
assert!(WalFrame::decode(&encoded).is_err());
349+
WalFrame::decode(&encoded).unwrap_err();
350350
}
351351

352352
#[test]
353353
fn truncated_header_rejected() {
354354
let frame = WalFrame::heartbeat(1);
355355
let encoded = frame.encode();
356-
assert!(WalFrame::decode(&encoded[..FRAME_HEADER_LEN - 1]).is_err());
356+
WalFrame::decode(&encoded[..FRAME_HEADER_LEN - 1]).unwrap_err();
357357
}
358358

359359
#[test]
360360
fn truncated_body_rejected() {
361361
let frame = WalFrame::data(1, 1, b"hello world test".to_vec());
362362
let mut encoded = frame.encode();
363363
encoded.truncate(encoded.len() - 3);
364-
assert!(WalFrame::decode(&encoded).is_err());
364+
WalFrame::decode(&encoded).unwrap_err();
365365
}
366366

367367
#[test]
@@ -385,14 +385,14 @@ mod tests {
385385

386386
#[test]
387387
fn batch_count_from_bytes_valid() {
388-
let mut fake = vec![0u8; 16];
389-
fake[8..12].copy_from_slice(&7u32.to_le_bytes());
388+
let mut fake = vec![0_u8; 16];
389+
fake[8..12].copy_from_slice(&7_u32.to_le_bytes());
390390
assert_eq!(batch_count_from_bytes(&fake), 7);
391391
}
392392

393393
#[test]
394394
fn batch_count_from_bytes_too_short() {
395-
assert_eq!(batch_count_from_bytes(&[0u8; 5]), 0);
395+
assert_eq!(batch_count_from_bytes(&[0_u8; 5]), 0);
396396
assert_eq!(batch_count_from_bytes(&[]), 0);
397397
}
398398
}

0 commit comments

Comments
 (0)