1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
pub use self::non_utf8::*;
pub use self::utf8::*;
mod non_utf8 {
#[cfg(unix)]
pub type NativePath = crate::unix::UnixPath;
#[cfg(unix)]
pub type NativePathBuf = crate::unix::UnixPathBuf;
#[cfg(unix)]
pub type NativeComponent<'a> = crate::unix::UnixComponent<'a>;
#[cfg(windows)]
pub type NativePath = crate::windows::WindowsPath;
#[cfg(windows)]
pub type NativePathBuf = crate::windows::WindowsPathBuf;
#[cfg(windows)]
pub type NativeComponent<'a> = crate::windows::WindowsComponent<'a>;
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn native_path_buf_should_be_cloneable() {
let path = NativePathBuf::from("hello.txt");
assert_eq!(path, path.clone());
}
}
}
mod utf8 {
#[cfg(unix)]
pub type Utf8NativePath = crate::unix::Utf8UnixPath;
#[cfg(unix)]
pub type Utf8NativePathBuf = crate::unix::Utf8UnixPathBuf;
#[cfg(unix)]
pub type Utf8NativeComponent<'a> = crate::unix::Utf8UnixComponent<'a>;
#[cfg(windows)]
pub type Utf8NativePath = crate::windows::Utf8WindowsPath;
#[cfg(windows)]
pub type Utf8NativePathBuf = crate::windows::Utf8WindowsPathBuf;
#[cfg(windows)]
pub type Utf8NativeComponent<'a> = crate::windows::Utf8WindowsComponent<'a>;
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn utf8_native_path_buf_should_be_cloneable() {
let path = Utf8NativePathBuf::from("hello.txt");
assert_eq!(path, path.clone());
}
}
}