Display cargo install crate-name rather than cargo add crate-name for binary crates (original) (raw)

Current Behavior

crates.io has an "Install" sections with copy-paste snippets to install the crate. It includes these two snippets:

For binary crates (e.g. ripgrep) this is not useful.

Expected Behavior

For crates that have a binary target, but not a library target, crates.io should show instead:

For crates that have both a binary target and a library target, crates.io should all three:

Steps To Reproduce

  1. Go to https://crates.io/crates/ripgrep
  2. Look at the page

Environment

Anything else?

No response