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
use std::borrow::Cow;
use std::cmp::Ordering;
use std::path::Path;
use std::path::PathBuf;
use super::BasePath;
use super::BasePathBuf;
macro_rules! r#impl {
( $left:ty , $right:ty ) => {
impl PartialEq<$right> for $left {
#[inline]
fn eq(&self, other: &$right) -> bool {
<BasePath as PartialEq<Path>>::eq(self, other.as_ref())
}
}
impl PartialEq<$left> for $right {
#[inline]
fn eq(&self, other: &$left) -> bool {
other == self
}
}
impl PartialOrd<$right> for $left {
#[inline]
fn partial_cmp(&self, other: &$right) -> Option<Ordering> {
<BasePath as PartialOrd<Path>>::partial_cmp(
self,
other.as_ref(),
)
}
}
impl PartialOrd<$left> for $right {
#[inline]
fn partial_cmp(&self, other: &$left) -> Option<Ordering> {
other.partial_cmp(self)
}
}
};
}
r#impl!(BasePathBuf, BasePath);
r#impl!(BasePathBuf, &BasePath);
r#impl!(Cow<'_, BasePath>, BasePath);
r#impl!(Cow<'_, BasePath>, &BasePath);
r#impl!(Cow<'_, BasePath>, BasePathBuf);
r#impl!(BasePathBuf, Path);
r#impl!(BasePathBuf, &Path);
r#impl!(BasePathBuf, Cow<'_, Path>);
r#impl!(BasePathBuf, PathBuf);
r#impl!(BasePath, &Path);
r#impl!(BasePath, Cow<'_, Path>);
r#impl!(BasePath, PathBuf);
r#impl!(&BasePath, Path);
r#impl!(&BasePath, Cow<'_, Path>);
r#impl!(&BasePath, PathBuf);