# Maverick Rust Ownership

> Rust ownership, borrowing, and lifetimes Use when this capability is needed.

- Skill: `tomevault-io/maverick-rust-ownership` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/maverick-rust-ownership`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/maverick-rust-ownership/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/maverick-rust-ownership

---


# Rust Ownership Skill

## Ownership Rules
1. Each value has exactly one owner
2. When owner goes out of scope, value is dropped
3. Values can be moved or borrowed

## Borrowing Rules
- One mutable reference OR any number of immutable references
- References must always be valid

```rust
let s = String::from("hello");
let r1 = &s;      // OK
let r2 = &s;      // OK
let r3 = &mut s;  // ERROR: can't borrow as mutable
```

## Lifetimes
```rust
fn longest<'a>(x: &'a str, y: &'a str) -> &'a str {
    if x.len() > y.len() { x } else { y }
}
```

## Review Severity
- **CRITICAL**: Dangling references, use after move
- **MAJOR**: Unnecessary clones, incorrect lifetime annotations
- **MINOR**: Could use references instead of owned values

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/get2knowio) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-15 -->

