diff options
| author | bors <bors@rust-lang.org> | 2015-02-19 18:36:59 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-02-19 18:36:59 +0000 |
| commit | 522d09dfecbeca1595f25ac58c6d0178bbd21d7d (patch) | |
| tree | cc0252dd3413e5f890d0ebcfdaa096e5b002be0b /src/libstd/old_path/posix.rs | |
| parent | 0b664bb8436f2cfda7f13a6f302ab486f332816f (diff) | |
| parent | 49771bafa5fca16486bfd06741dac3de2c587adf (diff) | |
| download | rust-1.0.0-alpha.2.tar.gz rust-1.0.0-alpha.2.zip | |
Auto merge of #22541 - Manishearth:rollup, r=Gankro 1.0.0-alpha.2
Continued from #22520
Diffstat (limited to 'src/libstd/old_path/posix.rs')
| -rw-r--r-- | src/libstd/old_path/posix.rs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/libstd/old_path/posix.rs b/src/libstd/old_path/posix.rs index 0a184a01a1d..15eee9e4a0c 100644 --- a/src/libstd/old_path/posix.rs +++ b/src/libstd/old_path/posix.rs @@ -100,12 +100,21 @@ impl FromStr for Path { #[derive(Debug, Clone, PartialEq, Copy)] pub struct ParsePathError; +#[cfg(stage0)] impl<S: hash::Writer + hash::Hasher> hash::Hash<S> for Path { #[inline] fn hash(&self, state: &mut S) { self.repr.hash(state) } } +#[cfg(not(stage0))] +#[stable(feature = "rust1", since = "1.0.0")] +impl hash::Hash for Path { + #[inline] + fn hash<H: hash::Hasher>(&self, state: &mut H) { + self.repr.hash(state) + } +} impl BytesContainer for Path { #[inline] @@ -1172,7 +1181,7 @@ mod tests { let exp: &[&[u8]] = &[$($exp),*]; assert_eq!(comps, exp); let comps = path.components().rev().collect::<Vec<&[u8]>>(); - let exp = exp.iter().rev().map(|&x|x).collect::<Vec<&[u8]>>(); + let exp = exp.iter().rev().cloned().collect::<Vec<&[u8]>>(); assert_eq!(comps, exp) } ) @@ -1204,7 +1213,7 @@ mod tests { let exp: &[Option<&str>] = &$exp; assert_eq!(comps, exp); let comps = path.str_components().rev().collect::<Vec<Option<&str>>>(); - let exp = exp.iter().rev().map(|&x|x).collect::<Vec<Option<&str>>>(); + let exp = exp.iter().rev().cloned().collect::<Vec<Option<&str>>>(); assert_eq!(comps, exp); } ) |
