cargo-hack
cargo-unused-features
cargo-hack | cargo-unused-features | |
---|---|---|
4 | 3 | |
555 | 201 | |
- | - | |
9.3 | 3.8 | |
4 days ago | 10 months ago | |
Rust | Rust | |
Apache License 2.0 | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
cargo-hack
-
What are some useful tools for Rust?
cargo-hack for workspaces or projects that make heavy use of crate features
-
Is there a known way to minimize features of dependencies after the code is done?
When I'm managing cargo flags myself I have also found cargo-hack useful to make sure that all of my possible combos still build and pass tests. Sometimes that's helped me find an implicit feature I needed to declare.
-
How to write generic code for both thread-local and concurrent modes?
As a note for OP, be sure to not try to use this approach for code that's intended to be mutually-exclusive approaches. Code based on features should be designed so that any combination of crate features can be enabled simultaneously, including zero or all of them. Ideally the crate should always build and run under any permutation - if you want a way to test this exhaustively you can run your tests via cargo-hack.
-
PSA - Most Rust tooling runs only on the default feature set and current platform if no special steps are taken
For features: You can use cargo-hack or cargo-all-features to run on all feature combinations.
cargo-unused-features
-
Is there a known way to minimize features of dependencies after the code is done?
You may want to try this, even though it's not very accurate now.
-
Find potential unused enabled feature flags and prune them with my new library.
Here is the issue: https://github.com/TimonPost/cargo-unused-features/issues/1. It would be nice if you can post your debug logs (run with `-l debug`) there alongside the generated JSON report.
What are some alternatives?
cargo-all-features - A Cargo subcommand to build and test all feature flag combinations.
cargo-sweep - A cargo subcommand for cleaning up unused build files generated by Cargo
cargo-cache - manage cargo cache (${CARGO_HOME}, ~/.cargo/), print sizes of dirs and remove dirs selectively
cargo-whatfeatures - a simple cargo plugin to get a list of features for a specific crate
just - 🤖 Just a command runner
rat-rs - A simple cli tool to fetch transports schedules on the Ile-de-France région
cargo-edit - A utility for managing cargo dependencies from the command line.
tarpaulin - A code coverage tool for Rust projects
cargo-deb - A cargo subcommand that generates Debian packages from information in Cargo.toml
reference - The Rust Reference
bacon - background rust code check