Why I built cargo-feat: A 10ms solution to feature lookup friction
The author created cargo-feat, a fast CLI tool for Rust developers to quickly look up crate features without opening a browser. It reduces feature lookup time to around 10ms by optimizing data retrieval from crates.io and using local caching. The tool supports various query options and is designed to streamline dependency management in Rust projects.
- ▪cargo-feat is a command-line tool that lists available features of Rust crates directly in the terminal.
- ▪It achieves speeds of about 9.9ms by using the crates.io sparse index, local cache, and early-stop parsing.
- ▪The tool can display default features, dependencies, and internal metadata, and supports JSON output.
- ▪cargo-feat is installable via cargo install cargo-feat and works for specific or latest crate versions.
- ▪Performance benchmarks show it is over 9 times faster than existing tools like cargo info.
Opening excerpt (first ~120 words) tap to expand
try { if(localStorage) { let currentUser = localStorage.getItem('current_user'); if (currentUser) { currentUser = JSON.parse(currentUser); if (currentUser.id === 3908215) { document.getElementById('article-show-container').classList.add('current-user-is-article-author'); } } } } catch (e) { console.error(e); } vun Posted on May 1 Why I built cargo-feat: A 10ms solution to feature lookup friction #rust #cargo #tooling #performance The Problem Every time I add a dependency to Cargo.toml, I need to know what features it exposes. Current workflow: Open browser Search crates.io or docs.rs Scroll through documentation Find the feature list Close browser Repeat 20 times a day. Annoying. Existing tools like cargo info exist but are slow (80ms+). The Solution Built cargo-feat. Single command.
…
Excerpt limited to ~120 words for fair-use compliance. The full article is at DEV.to (Top).