Fix code quality: trailing whitespace, unused imports, clippy warnings

- Fix trailing whitespace in kex.rs and s3.rs
- Add missing KexProposal import in kex_complete.rs
- Auto-fix clippy warnings across all crates
- All 153 tests pass
This commit is contained in:
Warren
2026-06-19 05:21:38 +08:00
parent 4b37e524cf
commit d94cb2df4c
135 changed files with 7256 additions and 4321 deletions

View File

@@ -146,7 +146,7 @@ impl DavLockSystem for LockManager {
let path_owned = path.clone();
let token = format!("urn:uuid:{}", Uuid::new_v4());
let principal_str = principal.map(|s| s.to_string());
let owner_clone = owner.map(|e| e.clone());
let owner_clone = owner.cloned();
let owner_xml = owner.and_then(|e| {
let mut buf = Vec::new();
e.write(&mut buf).ok()?;
@@ -175,7 +175,7 @@ impl DavLockSystem for LockManager {
token: String::new(),
path: Box::new(path_owned.clone()),
principal: principal_str.clone(),
owner: owner_clone.map(|e| Box::new(e)),
owner: owner_clone.map(Box::new),
timeout_at: None,
timeout,
shared,
@@ -229,7 +229,7 @@ impl DavLockSystem for LockManager {
token,
path: Box::new(path_owned.clone()),
principal: principal_str,
owner: owner_clone.map(|e| Box::new(e)),
owner: owner_clone.map(Box::new),
timeout_at: timeout_at
.map(|t| SystemTime::UNIX_EPOCH + Duration::from_secs(t as u64)),
timeout,
@@ -400,31 +400,29 @@ impl DavLockSystem for LockManager {
deep: false,
})?;
for lock_result in locks {
if let Ok(lock) = lock_result {
if tokens.contains(&lock.token) {
continue;
}
for lock in locks.flatten() {
if tokens.contains(&lock.token) {
continue;
}
if ignore_principal {
continue;
}
if ignore_principal {
continue;
}
if let Some(ref lock_principal) = lock.principal {
if let Some(ref check_principal) = principal_str {
if lock_principal == check_principal {
continue;
}
if let Some(ref lock_principal) = lock.principal {
if let Some(ref check_principal) = principal_str {
if lock_principal == check_principal {
continue;
}
}
}
if deep && lock.deep {
return Err(lock);
}
if deep && lock.deep {
return Err(lock);
}
if !deep {
return Err(lock);
}
if !deep {
return Err(lock);
}
}