fuck-backslash

Crates.iofuck-backslash
lib.rsfuck-backslash
version0.1.0
created_at2025-01-03 08:02:15.69745+00
updated_at2025-01-03 08:02:15.69745+00
descriptionA simple crate to replace the backslash with slash in-place in your PathBuf.
homepagehttps://github.com/lxl66566/fuck-backslash
repositoryhttps://github.com/lxl66566/fuck-backslash
max_upload_size
id1502214
size6,309
Absolutex (lxl66566)

documentation

README

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"));
Commit count: 1

cargo fmt