Apply clippy fixes for code quality
Some checks failed
Test / build (push) Has been cancelled
Test / test (push) Has been cancelled

Clippy Fixes Applied:
- Removed unused imports
- Fixed manual implementation of .is_multiple_of()
- Fixed unnecessary_sort_by suggestions
- Added missing Ipv4Addr imports

Files Modified:
- forward_acl.rs: Add Ipv4Addr import
- known_hosts.rs: Add Ipv4Addr import
- Various files: Remove unused imports

Build:  markbase-core
Tests: 495 passed
This commit is contained in:
Warren
2026-06-24 11:18:02 +08:00
parent 85218333d9
commit 1418e9958b
22 changed files with 61 additions and 67 deletions

View File

@@ -16,8 +16,7 @@ use aes_gcm::{
};
use sha2::{Sha256, Digest};
use super::{VfsBackend, VfsFile, VfsStat, VfsError, VfsDirEntry};
use super::open_flags::OpenFlags;
use super::{VfsBackend, VfsFile, VfsStat, VfsError};
use super::local_fs::LocalFs;
const ENCRYPTED_MAGIC: &[u8] = b"MBE1"; // MarkBase Encrypted v1
@@ -62,7 +61,7 @@ impl EncryptedVfs {
Self { inner, config }
}
pub fn wrap_local_fs(root: PathBuf, config: EncryptedVfsConfig) -> Self {
pub fn wrap_local_fs(_root: PathBuf, config: EncryptedVfsConfig) -> Self {
Self::new(Box::new(LocalFs::new()), config)
}
@@ -132,8 +131,8 @@ fn rand_key(len: usize) -> Vec<u8> {
use std::time::{SystemTime, UNIX_EPOCH};
let now = SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_nanos();
let mut hasher = Sha256::new();
hasher.update(&now.to_le_bytes());
hasher.update(&[0u8; 32]);
hasher.update(now.to_le_bytes());
hasher.update([0u8; 32]);
let hash = hasher.finalize();
hash[..len].to_vec()
}