I have to convert the PathBuf
variable to a String
to feed my function. My code is like this:
let cwd = env::current_dir().unwrap();
let my_str: String = cwd.as_os_str().to_str().unwrap().to_string();
println!("{:?}", my_str);
it works but is awful with the cwd.as_os_str…
.
Do you have a more convenient method or any suggestions on how to handle it?