| Crates.io | fuck-backslash |
| lib.rs | fuck-backslash |
| version | 0.1.0 |
| created_at | 2025-01-03 08:02:15.69745+00 |
| updated_at | 2025-01-03 08:02:15.69745+00 |
| description | A simple crate to replace the backslash with slash in-place in your PathBuf. |
| homepage | https://github.com/lxl66566/fuck-backslash |
| repository | https://github.com/lxl66566/fuck-backslash |
| max_upload_size | |
| id | 1502214 |
| size | 6,309 |
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.
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"));