Crabrix blog · Page 2 of 3

Rust guides and news: page 2.

Practical guides to Cargo builds, memoization, ownership, text and testing, alongside carefully sourced Rust release and infrastructure news.

Articles 13–24 of 33 · Newest first

· 9 min read

Rust text input: buffered reading without lost errors

Read text reliably in Rust with BufRead, Cursor and reusable buffers. Preserve I/O errors, define line rules, and validate records before changing state.

Read article →
· 8 min read

Rust traits and generics: choose a clear dispatch boundary

Design small Rust traits, use generic bounds, and understand borrowed dyn trait objects. Compare dispatch choices without invented performance claims.

Read article →
· 11 min read

Rust enums and state machines: make invalid states explicit

Model Rust workflows with enums, data-bearing variants and explicit transitions. Handle invalid commands, preserve state on failure, and test every edge.

Read article →
· 8 min read

Rust numeric safety: checked arithmetic and honest conversions

Choose explicit Rust overflow and conversion policies. Compare checked, wrapping and saturating arithmetic, handle narrowing, and test numeric boundaries.

Read article →
· 9 min read

Rust HashMap: count with entry and produce stable reports

Build a reliable Rust word counter with HashMap entry. Handle missing keys, choose borrowed or owned keys, and sort output for repeatable reports.

Read article →
· 11 min read

Cargo features: smaller builds and portable dependencies

Understand Cargo feature unification, defaults and target limits. Design additive features, inspect dependency requests, and test portable configurations.

Read article →
· 9 min read

Rust pattern matching: handle missing values without panics

Use match, if let and let else to handle optional values, validate variants, borrow fields and keep failure paths visible in practical Rust code.

Read article →
· 11 min read

Testing Rust: useful fixtures, boundaries and doctests

Write Rust tests that catch real mistakes. Choose useful boundaries, build deterministic fixtures, and connect unit tests, integration tests and doctests.

Read article →
· 12 min read

Rust memoization: cache keys, limits and failure handling

Implement memoization in Rust without hiding stale results or errors. Build tested caches with explicit keys, revision handling and capacity rules.

Read article →
· 11 min read

Rust strings and UTF-8: parse text without broken boundaries

Understand String, str and UTF-8 boundaries. Parse text safely, distinguish bytes from characters, and return useful errors instead of panicking.

Read article →
· 11 min read

Rust iterators: clear pipelines without extra allocations

Learn how Rust iterators borrow, consume and short-circuit. Build clear pipelines, avoid needless collections, and keep malformed input visible.

Read article →
· 12 min read

Cargo build.rs: generated code and reliable rebuilds

Build a complete Cargo code generator with tracked file and environment inputs. Understand OUT_DIR, host versus target, and reliable rebuild tests.

Read article →