archival 0.19.0

The simplest CMS in existence
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use crate::util::path_to_native;
use std::path::Path;

/// Rewrites a `/`-separated path literal into the platform's native form, so
/// tests can compare hardcoded paths against paths a filesystem produced.
/// `Path::new` does not do this on windows - it accepts `/` as a separator but
/// preserves it when converting back to a string.
pub fn as_path_str(string: &str) -> String {
    path_to_native(Path::new(string))
        .to_string_lossy()
        .to_string()
}