Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Guides idiomatic Rust writing, review, and refactoring covering ownership, error handling, async code, public APIs, and performance.
Use this skill ↓64% 59%−5 ptsof test cases passed
Passed 13 of 22 test cases with the skill, and 14 of 22 without it.
3 of 3 safety checks passed
Use this skill to keep Rust changes idiomatic, maintainable, and easy to verify.
Result for recoverable failures and reserve panic!, unwrap, and expect for tests, impossible states with a clear message, or process-fatal startup validation.cargo fmt, focused cargo test, and cargo clippy --workspace --all-targets when the change warrants it.// Avoid: forces callers to allocate or give up ownership.
fn load_config(path: PathBuf) -> Result<Config, ConfigError> {
std::fs::read_to_string(path)?.parse()
}
// Prefer: accepts Path, PathBuf, and path-like wrappers.
fn load_config(path: impl AsRef<std::path::Path>) -> Result<Config, ConfigError> {
std::fs::read_to_string(path)?.parse()
}
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.