Does cargo install have an equivalent update comma

2019-01-23 00:39发布

I'd like to update a package that I used cargo install to globally install packages, such as rustfmt or racer. I can't find a way to update an installed package without first deleting it (via cargo uninstall) and then running the install command again. Is there an update command?

4条回答
狗以群分
2楼-- · 2019-01-23 01:11

A solution I've found is to add the --force flag to the install command. For example cargo install --force clippy. This will effectively re-install the latest version.

查看更多
不美不萌又怎样
3楼-- · 2019-01-23 01:15

There is no such command in vanilla cargo (well, there's cargo install but that's for dependencies), but since cargo supports third-party subcommands there is an answer: the cargo-update crate.

Install as usual with cargo install cargo-update, then use cargo install-update -a to update all installed packages, for more usage information and examples see the cargo install-update manpage.

Disclaimer: am author

查看更多
闹够了就滚
4楼-- · 2019-01-23 01:19

Nope. You can discuss it in this issue.

查看更多
别忘想泡老子
5楼-- · 2019-01-23 01:19

The command to update dependencies is cargo update

Source : http://doc.crates.io/guide.html

查看更多
登录 后发表回答