feat(#84): clippy::unwrap_used/expect_used guard for the Rust SDK #5
No reviewers
Labels
No labels
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
h-dv/ixt-sdk-rust!5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/84-unwrap-used-guard"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Final crate of the runtime-side #84 panic-guard rollout (ixt-core → host/cli/bundle/codegen → SDK). The MIT SDK is what module authors build against, so a bare
.unwrap()that fires inside it crashes their module — exactly the panic-on-bug surface #84 closes.Changes
#![warn(clippy::unwrap_used, clippy::expect_used)]at the crate root (src/lib.rs). The SDK CI gate iscargo clippy -- -D warnings, so these are effectively deny.clippy.tomlwithallow-unwrap-in-tests/allow-expect-in-tests(mirrors the superproject) — test code may panic freely.*_capnp.rsmodules (module/services/ipc_services/ipc_streaming) get explicit#[allow(clippy::unwrap_used, clippy::expect_used)]—clippy::alldoes not cover restriction-group lints, so the existing#[allow(clippy::all)]was insufficient.Production-path fixes
conversions.rs::response_from_capnp(8 sites).expect()on Cap'n ProtoResultdecode →?-propagated asIxtError::internal. The fn already returnsResultand carried inline// TODO: Replace expects with proper error handling. A malformedResponseon the wire now returns an error instead of crashing the module.types.rs::SessionToken(2 sites)SystemTime::now().duration_since(UNIX_EPOCH).unwrap()→unwrap_or_default(); a pre-epoch clock is impossible andZEROis a safe non-panicking fallback.One ALLOW-with-reason
ffi_services.rs::capnp_serialize— writing a capnp message into an in-memoryVec<u8>is infallible except on OOM (which aborts anyway).Test plan
cargo clippy -- -D warnings(SDK CI gate) GREENcargo clippy --all-targets -- -D warningsGREENcargo test --lib— 24/24 passcargo check --all-targetsclean (examples build)cargo fmt --all --checkcleanLockstep: superproject submodule pin bumps to this branch's merge commit after merge. Closes the SDK leg of #84.
🤖 Generated with Claude Code