Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Code Style

Formatting

The project uses rustfmt with settings in rustfmt.toml. Format before committing:

cargo fmt --all

Lints

Clippy is configured at maximum strictness in Cargo.toml:

  • clippy::pedantic — enabled
  • clippy::expect_useddenied (no .expect() outside tests)
  • clippy::unwrap_useddenied (no .unwrap() outside tests)
  • clippy::indexing_slicingdenied (use .get() with explicit handling)

Run the full lint check:

cargo clippy --workspace --all-targets -- -D warnings

Lint Suppression

Use #[expect(lint)] instead of #[allow(lint)]. The expect attribute warns if the suppressed lint stops firing, preventing stale suppressions from accumulating.

#![allow(unused)]
fn main() {
#[expect(clippy::cast_possible_truncation)]
fn small_index(n: usize) -> u8 {
    n as u8
}
}

Error Handling

  • All error types use thiserror.
  • No anyhow in domain/ or adapters/.
  • Propagate errors with ?. Match or if let when recovery is needed.

Commits

Use conventional commits:

feat: add dead-drop platform support
fix: handle empty cover image gracefully
refactor: extract shard validation into helper
test: add ZWJ emoji round-trip tests
docs: document time-lock calibration

Standard Library Preferences

Prefer modern standard library features over third-party crates:

PreferOver
std::sync::LazyLocklazy_static!, once_cell
Vec::extract_ifmanual filter/retain loops
<[T]>::array_windowsmanual index arithmetic
str::floor_char_boundaryunchecked byte slicing
strict_add / strict_sub / strict_mulchecked_add().unwrap()