From 3ce9dba6775c7e1dbfb510626c073a8f926b6880 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 2 May 2013 18:33:27 -0400 Subject: std: Use the new `for` protocol --- src/libstd/workcache.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/libstd/workcache.rs') 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 { -- cgit 1.4.1-3-g733a5