1 unstable release
0.1.0 | Jan 3, 2025 |
---|
#763 in Rust patterns
136 downloads per month
4KB
fuck-backslash
Did you suffer from the problem that \
breaks your path? For me, I have to record paths into a configuration file and use it cross-platform. If I create the configuration on windows, it will break my program when I run it on linux.
This is a simple crate to replace the backslash \
with slash /
in-place in your PathBuf
.
Usage
use fuck_backslash::*;
let path = PathBuf::from("C:\\Users\\xxx\\Desktop\\test.txt");
assert_eq!(path.fuck_backslash(), PathBuf::from("C:/Users/xxx/Desktop/test.txt"));