Move AGENTS.md sections into docs folder

This commit is contained in:
Ansho Rei
2026-09-04 14:10:50 +02:00
parent f877e6dbf2
commit 9c224fb768
26 changed files with 806 additions and 662 deletions
+11
View File
@@ -0,0 +1,11 @@
# Rust Style
The small conventions this tree keeps in its Rust.
- Use `if matches!(expr, Variant)` instead of `if let Some(Variant) = expr` for enum variant matching
- Use `if let Some(x) = expr` instead of `if let Some(Some(x)) = expr` — drop unnecessary nesting
- Prefer explicit `match` over `unwrap_or_default()` for clarity
- Use `unwrap_or_else(|| expr)` for lazy defaults, `unwrap_or(val)` for eager defaults
- Use `anyhow!()` with context strings that include identifying info (e.g. UUID, title) not bare values
- A command whose arguments run past a handful takes a clap `Args` struct, not an inline variant with a matching parameter list: `AddArgs`, `SetArgs`, `AppendArgs`, `CheckArgs`, `MvArgs`. `add` was nine positional parameters threaded from `main` before it became `AddArgs`, and the handler destructures the struct so the body reads the same as before. `mv` was the last inline variant to carry an `--actor`, and `--actor-from-git` pushed its list past the line