diff options
Diffstat (limited to 'src/fs.rs')
-rw-r--r-- | src/fs.rs | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -34,3 +34,13 @@ pub fn mkdir(path: &Path) -> std::io::Result<()> { } }) } + +pub fn normalize_path(path: &Path) -> String { + let s = String::from(path.to_str().unwrap()); + if cfg!(windows) { + // TODO This isn't correct. Probbly should iterate over components. + s.replace("\\", "/") + } else { + s + } +} |