3
votes

I'm trying to practice rust using exercism

one of problem set has a test file like this enter image description here

when i tried to run Cargo test, its not recognizing the crate name.I tried different variations difference-of-squares,"difference-of-squares" with no success.enter image description here

contents of Cargo.toml

enter image description here

edit: I tried with both stable release and the current nightly.

1
Please do not post code as images. Take the time to copy and paste the code into Stack Overflow. This helps for searching, and also allows for technology like screen readers to be used.Shepmaster

1 Answers

5
votes

You're likely using an old version of Cargo. Previously, crates-with-hyphens were allowed, but horrible to use:

extern crate "difference-of-squares" as squares;

At some point in the past, Cargo was changed to basically not allow them; it just converted all hyphens to underscores so you didn't have to manually rename every crate that had hyphens in its name, every time you used it.

You haven't specified what version you're using, but updating to the latest release (Rust 1.2 just got released will be released in a few days) should fix it. Failing that, try quoting the literal name of the crate.