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.



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:

foo = "=0.1.2"

See also:


I replaced the line
ncurses = "5.93.0"
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"


Got it. I missed the extra ‘=’