преобразовать путь в PathBuf
let path = Path::new("some_thing/hi.txt");
let mut path_buf = PathBuf::new();
path_buf.push(path);
ali ahmed
let path = Path::new("some_thing/hi.txt");
let mut path_buf = PathBuf::new();
path_buf.push(path);