Skip to content

Commit 4d3c37c

Browse files
committed
fix(server): satisfy clippy in inherited-gating restore assertion
Clippy's unnecessary_unwrap fires on unwrap_err() after an is_ok() check, failing the workspace lint under -D warnings. Bind the status directly with if let Err instead. Signed-off-by: Philippe Martin <[email protected]>
1 parent 198906a commit 4d3c37c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎crates/openshell-server/src/grpc/policy.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9630,14 +9630,14 @@ mod tests {
96309630
);
96319631
remove.expect("removing the offending rule must be possible");
96329632

9633-
if restore.is_ok() {
9633+
if let Err(status) = restore {
9634+
assert_eq!(status.code(), Code::FailedPrecondition);
9635+
} else {
96349636
let stored = get_sandbox_policy(&state, "sb-inherited-gating").await;
96359637
assert!(
96369638
!stored.network_policies.contains_key("pypi"),
96379639
"a replacement validated against a stale revision restored the endpoint"
96389640
);
9639-
} else {
9640-
assert_eq!(restore.unwrap_err().code(), Code::FailedPrecondition);
96419641
}
96429642
}
96439643

0 commit comments

Comments
 (0)