Here is the error:
let tmp = tempdir::TempDir::new("cargo_test").expect("failed to create tempdir");
^^^^^^^ use of undeclared crate or module `tempdir`
My cargo.toml looks like this:
#...
[dev-dependencies]
tempdir = "0.3.7
And in the code:
let path = if cfg!(test) {
let tmp = tempdir::TempDir::new("cargo_test").expect("failed to create tempdir");
tmp.path().to_str().map(|x| x.to_string()).unwrap_or(path)
} else {
path
};
I do not understand why it fails, when i run cargo test
. :(