A: Code quality improvements - fix clippy warnings
- Remove unused imports in server.rs (Body, HeaderValue, RwLock) - Remove unused imports in forward_acl.rs (tests still need Ipv4Addr) - Remove unused imports in host_key.rs (Read, Write) - Remove unused imports in kex_exchange.rs (HostKeyType) - Remove unused imports in known_hosts.rs (tests need Ipv4Addr) - Remove unused imports in multiplex.rs (Arc) - Auto-fix other unused imports via clippy --fix Tests: 303 passed, 0 failed (4 new tests added)
This commit is contained in:
@@ -196,8 +196,8 @@ impl VfsBackend for LocalFs {
|
||||
.map_err(|_| VfsError::Io("mtime before UNIX_EPOCH".to_string()))?;
|
||||
filetime::set_file_times(
|
||||
path,
|
||||
filetime::FileTime::from_unix_time(at.as_secs() as i64, at.subsec_nanos() as u32),
|
||||
filetime::FileTime::from_unix_time(mt.as_secs() as i64, mt.subsec_nanos() as u32),
|
||||
filetime::FileTime::from_unix_time(at.as_secs() as i64, at.subsec_nanos()),
|
||||
filetime::FileTime::from_unix_time(mt.as_secs() as i64, mt.subsec_nanos()),
|
||||
)
|
||||
.map_err(|e| util::map_io_error(path, e))
|
||||
}
|
||||
@@ -207,7 +207,7 @@ impl VfsBackend for LocalFs {
|
||||
.map_err(|_| VfsError::Io("atime before UNIX_EPOCH".to_string()))?;
|
||||
filetime::set_file_atime(
|
||||
path,
|
||||
filetime::FileTime::from_unix_time(at.as_secs() as i64, at.subsec_nanos() as u32),
|
||||
filetime::FileTime::from_unix_time(at.as_secs() as i64, at.subsec_nanos()),
|
||||
)
|
||||
.map_err(|e| util::map_io_error(path, e))
|
||||
}
|
||||
@@ -217,7 +217,7 @@ impl VfsBackend for LocalFs {
|
||||
.map_err(|_| VfsError::Io("mtime before UNIX_EPOCH".to_string()))?;
|
||||
filetime::set_file_mtime(
|
||||
path,
|
||||
filetime::FileTime::from_unix_time(mt.as_secs() as i64, mt.subsec_nanos() as u32),
|
||||
filetime::FileTime::from_unix_time(mt.as_secs() as i64, mt.subsec_nanos()),
|
||||
)
|
||||
.map_err(|e| util::map_io_error(path, e))
|
||||
}
|
||||
@@ -483,7 +483,7 @@ impl VfsBackend for LocalFs {
|
||||
for entry in fs::read_dir(&snapshots_dir)
|
||||
.map_err(|e| util::map_io_error(&snapshots_dir, e))? {
|
||||
let entry = entry.map_err(|e| VfsError::Io(e.to_string()))?;
|
||||
let snapshot_name = entry.file_name().to_string_lossy().to_string();
|
||||
let _snapshot_name = entry.file_name().to_string_lossy().to_string();
|
||||
let snapshot_path = entry.path();
|
||||
|
||||
let meta_file = snapshot_path.join(".meta");
|
||||
@@ -559,11 +559,10 @@ impl VfsBackend for LocalFs {
|
||||
let acl = self.get_acl(path)?;
|
||||
|
||||
for ace in &acl.aces {
|
||||
if ace.principal == principal || ace.principal == "*" {
|
||||
if ace.mask.contains(&mask) {
|
||||
if (ace.principal == principal || ace.principal == "*")
|
||||
&& ace.mask.contains(&mask) {
|
||||
return Ok(ace.ace_type == VfsAceType::Allow);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ok(true)
|
||||
|
||||
Reference in New Issue
Block a user