src/maverick/skills/maverick_rust_unsafe/SKILL.md
Rust unsafe code, FFI, and safety invariants
npx skillsauth add get2knowio/maverick maverick-rust-unsafeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
/// SAFETY: The slice is guaranteed to be non-empty by the caller.
/// This is enforced by the type system via NonEmptySlice.
unsafe fn get_first_unchecked(slice: &[i32]) -> i32 {
debug_assert!(!slice.is_empty());
*slice.get_unchecked(0)
}
// BAD - unjustified unsafe
unsafe fn get_first(slice: &[i32]) -> i32 {
*slice.get_unchecked(0)
}
// GOOD - safe alternative
fn get_first(slice: &[i32]) -> Option<&i32> {
slice.first()
}
development
Rust testing patterns (unit, integration, property-based)
development
Rust performance optimization and zero-cost abstractions
development
Rust ownership, borrowing, and lifetimes
development
Rust error handling with Result, Error trait, anyhow, thiserror