rust-modern-apis
Modern Rust APIs (1.89 – 1.94)
This skill is a lookup table for stable Rust APIs added after 1.88. Use it when writing or reviewing Rust code — replace older verbose patterns with newer concise ones where the project's MSRV allows.
How to use this skill
-
Check the project's MSRV first. Look at
Cargo.tomlforrust-version = "X.Y". Only suggest APIs available at or below the MSRV. If MSRV is lower than an API's version, either skip the suggestion or note that "raising MSRV to X.Y unlocks this." -
Scan the code for trigger patterns (see section below). Each trigger maps to a newer API. When you see one, suggest the replacement with a brief before/after.
-
For detailed API info, read the matching reference file in
references/. Files are organized by domain, not by version. -
Don't over-apply. Some patterns are fine as-is. Only suggest a change when the new API is clearly better (shorter, safer, or fixes a subtle bug).
Trigger patterns — fastest lookup
Scan for these code shapes first. Each points to a concrete API that replaces it.