this post was submitted on 20 Jun 2023
10 points (100.0% liked)

Rust

6440 readers
26 users here now

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

[email protected]

Credits

  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)

founded 2 years ago
MODERATORS
 

Cargo comes with quite a lot of nifty things pre-packaged, like fmt, clippy and so on. But there are a lot of addons out there, and it is a bit hard to discover these, so I thought it would be interesting to hear what everybody is using. The things I have installed is:

  • cargo-outdated - Find outdated dependencies
  • cargo-udeps - Find unused dependencies
  • cargo-flamegraph - Performance analysis
  • cargo-about - I use it to list licenses

Of these, it is cargo-outdated I use frequently. So, what is your cargo addon you cannot live without.

top 9 comments
sorted by: hot top controversial new old
[–] [email protected] 5 points 2 years ago (2 children)

I'd like to add:

  • cargo-feature
  • cargo-watch
  • cargo-expand
  • cargo-show-asm
[–] [email protected] 2 points 2 years ago

cargo-feature

cargo add can add and show features. The only thing its missing is removing of features.

[–] [email protected] 1 points 2 years ago

cargo-feature seems like a nice thing to have... will definitely try that.

[–] [email protected] 4 points 2 years ago* (last edited 2 years ago)

cargo-audit is great for keeping an eye on what dependencies have known vulnerabilities and need upgrading. Not something I use for every side project, but is used frequently on the systems we have running at work.

[–] [email protected] 3 points 2 years ago

There are add-ons?

[–] [email protected] 1 points 2 years ago

Instead of cargo addons I mostly use this neovim plugin: https://github.com/Saecki/crates.nvim. I can add a dependency by typing it in Cargo.toml, and it shows me the latest version number, and tells me whether I guessed wrong about dashes vs underscores in the package name. It shows virtual text next to crates that have upgrades available. It has commands for upgrading the crate under the cursor, or all crates. It has an interactive feature selector.

What I could still use is cargo-udeps. I'll check that one out!

[–] [email protected] 1 points 2 years ago* (last edited 2 years ago) (1 children)
[–] [email protected] 2 points 2 years ago (1 children)

But that is builtin... right?

[–] [email protected] 1 points 2 years ago

Perhaps, there could be a different between cargo-update and cargo update.

load more comments
view more: next ›