How do I downgrade a crate?

What do I have to do to downgrade a crate?

I changed Cargo.toml dependencies section but on build no new (older) version down loaded
So I hunted around and removed the crate from .cargo/registry/cache and .cargo/src then on build it downloaded not the version that I was trying to install but the original version.

Worik

By default, dependencies are “caret requirements”, which means that compatible upgrades are allowed. Try doing something like this in your Cargo.toml file to specify an exact version:

[dependencies]
foo = "=0.1.2"

See also: https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html

1 Like

I replaced the line
ncurses = "5.93.0"
with
ncurses = "5.91.0"
and no matter what I do version 5.93 is installed

Make sure you use the extra equals sign inside the version string:

ncurses = "=5.91.0"
1 Like

Got it. I missed the extra ‘=’

Thanks