我如何降级或安装我用 `cargo install` 安装的工具的旧版本?

How can I downgrade or install an older version of a tool I installed with `cargo install`?

我想在我的机器上安装 Xargo v0.3.10。 Xargo 当前版本为 v0.3.11,通过 cargo install xargo 命令安装。如何安装旧版本的 Xargo?

cargo install --version 0.3.10 xargo

阅读 cargo 工具的帮助非常有用:

$ cargo install --help
cargo-install
Install a Rust binary

USAGE:
    cargo install [OPTIONS] [--] [crate]...

OPTIONS:
        --version <VERSION>      Specify a version to install from crates.io

[... snip ...]

如果您已经安装了该工具的某个版本,则需要添加 -f / --force 标志:

-f, --force                  Force overwriting existing crates or binaries

另请参阅: