Misunderstanding of PathBuf:push
⚓ Rust 📅 2025-06-24 👤 surdeus 👁️ 16The situation:
let mut p = PathBuf::from("/var");
p.push("/");
println!("{}", p.to_string_lossy()); // ?
Now, when I converting this path to the string type, it has / path (not /var as expected)
5 posts - 3 participants
🏷️ rust_feed