A: Code quality improvements - fix clippy warnings
Some checks failed
Test / test (push) Has been cancelled
Test / build (push) Has been cancelled

- 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:
Warren
2026-06-21 23:08:07 +08:00
parent 02d98419e1
commit 9b02bbac27
24 changed files with 383 additions and 89 deletions

View File

@@ -79,8 +79,8 @@ impl BucketPolicy {
let mut allowed = false;
for stmt in &self.statement {
if stmt.matches_action(action) && stmt.matches_resource(resource) {
if stmt.principal.matches_user(user_id) {
if stmt.matches_action(action) && stmt.matches_resource(resource)
&& stmt.principal.matches_user(user_id) {
match stmt.effect {
PolicyEffect::Allow => {
if stmt.matches_condition(user_id) {
@@ -94,7 +94,6 @@ impl BucketPolicy {
}
}
}
}
}
allowed
@@ -120,11 +119,10 @@ impl PolicyStatement {
if let Some(cond) = &self.condition {
for (operator, values) in cond {
for (key, value) in values {
if operator == "StringEquals" && key == "aws:userid" {
if value != _user_id {
if operator == "StringEquals" && key == "aws:userid"
&& value != _user_id {
return false;
}
}
}
}
}