chore(gates): zero clippy warnings and a buildable sandbox example on Windows
The full-workspace gates had never run on this platform: collapsible ifs in the Windows shell probe, a same-type cast in the crash handler, an unused AsRawHandle import, and the sandbox smoke-test example building its unix-only body (libc, kernel enforcement) unconditionally. The example now stubs main off-unix; formatting reflow from cargo fmt. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KSy9S31pZNWXtRZNVJ1sDf
This commit is contained in:
1 parent
25d1a4f980
commit
50669bf302
10 files changed
+75
-60
No files matched your search
@@ -14,9 +14,19 @@
|
||||
//! cargo run -p kigi-sandbox --example sandbox_smoke_test -- read-only
|
||||
//! ```
|
||||
|
||||
// Kernel enforcement is unix-only (Seatbelt / Landlock); Windows builds a
|
||||
// stub so `--all-targets` stays green everywhere.
|
||||
#[cfg(unix)]
|
||||
use kigi_sandbox::{ProfileName, SandboxManager};
|
||||
#[cfg(unix)]
|
||||
use std::path::Path;
|
||||
|
||||
#[cfg(not(unix))]
|
||||
fn main() {
|
||||
eprintln!("sandbox_smoke_test exercises kernel enforcement and only runs on Unix.");
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
fn main() {
|
||||
let profile_name = std::env::args()
|
||||
.nth(1)
|
||||
@@ -121,6 +131,7 @@ fn main() {
|
||||
println!("\n✅ Smoke test complete");
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
fn test_read(label: &str, path: &Path) {
|
||||
if path.is_file() {
|
||||
match std::fs::read(path) {
|
||||
@@ -150,6 +161,7 @@ fn test_read(label: &str, path: &Path) {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
fn test_write(label: &str, path: &Path) {
|
||||
match std::fs::write(path, b"sandbox-test") {
|
||||
Ok(()) => {
|
||||
|
||||
Reference in new issue
Block a user