diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2013-05-02 18:33:27 -0400 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2013-05-10 02:46:18 -0400 |
| commit | 3ce9dba6775c7e1dbfb510626c073a8f926b6880 (patch) | |
| tree | b4c89fe29979a959c75f783ebe766d0cd6734254 /src/libstd/workcache.rs | |
| parent | 28256052a4b141350dc0fe4e2e5357137bb49706 (diff) | |
| download | rust-3ce9dba6775c7e1dbfb510626c073a8f926b6880.tar.gz rust-3ce9dba6775c7e1dbfb510626c073a8f926b6880.zip | |
std: Use the new `for` protocol
Diffstat (limited to 'src/libstd/workcache.rs')
| -rw-r--r-- | src/libstd/workcache.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libstd/workcache.rs b/src/libstd/workcache.rs index dc9204f62f4..9b0a6cb6226 100644 --- a/src/libstd/workcache.rs +++ b/src/libstd/workcache.rs @@ -99,6 +99,7 @@ struct WorkKey { name: ~str } +#[cfg(stage0)] impl to_bytes::IterBytes for WorkKey { #[inline(always)] fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) { @@ -108,6 +109,13 @@ impl to_bytes::IterBytes for WorkKey { self.name.iter_bytes(lsb0, f); } } +#[cfg(not(stage0))] +impl to_bytes::IterBytes for WorkKey { + #[inline(always)] + fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool { + self.kind.iter_bytes(lsb0, f) && self.name.iter_bytes(lsb0, f) + } +} impl cmp::Ord for WorkKey { fn lt(&self, other: &WorkKey) -> bool { |
