diff --git a/src/utils/utils.rs b/src/utils/utils.rs index 44ec0b4c117..fd01121ca12 100644 --- a/src/utils/utils.rs +++ b/src/utils/utils.rs @@ -739,7 +739,7 @@ impl<'a> io::Read for FileReaderWithProgress<'a> { // search user database to get home dir of euid user #[cfg(unix)] pub fn home_dir_from_passwd() -> Option { - use std::ffi::CStr; + use std::ffi::{OsString, CStr}; use std::mem::MaybeUninit; use std::os::unix::ffi::OsStringExt; use std::ptr; diff --git a/tests/cli-paths.rs b/tests/cli-paths.rs index baa6b3be087..ed4e7d59ce6 100644 --- a/tests/cli-paths.rs +++ b/tests/cli-paths.rs @@ -314,12 +314,12 @@ mod windows { fn install_uninstall_affect_path() { clitools::setup(Scenario::Empty, &|config| { with_saved_path(&|| { - let path = config.cargodir.join("bin").to_string_lossy().to_string(); + let path = format!("{:?}", config.cargodir.join("bin").to_string_lossy()); expect_ok(config, &INIT_NONE); assert!( - get_path().unwrap().to_string().contains(&path), - format!("`{}` not in `{}`", get_path().unwrap(), &path) + get_path().unwrap().to_string().contains(path.trim_matches('"')), + format!("`{}` not in `{}`", path, get_path().unwrap()) ); expect_ok(config, &["rustup", "self", "uninstall", "-y"]);