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

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.