diff options
| author | Michael Arntzenius <daekharel@gmail.com> | 2012-11-28 22:55:51 -0500 |
|---|---|---|
| committer | Michael Arntzenius <daekharel@gmail.com> | 2012-12-02 17:48:32 -0500 |
| commit | ef2c404e01108a7bd7465bd23d40ff989848bffd (patch) | |
| tree | 82fb84a9c2e927d3e2e46c4646b903422c6428fb /src/libcore | |
| parent | d718bc292d342a99580ec971dc7e873e5fc6e5c4 (diff) | |
libcore/to_bytes.rs: fix IterBytes instances for pairs, triples to not cause ICE when used
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/to_bytes.rs | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/libcore/to_bytes.rs b/src/libcore/to_bytes.rs index 3aaa3ab8d91..238b4342a63 100644 --- a/src/libcore/to_bytes.rs +++ b/src/libcore/to_bytes.rs @@ -194,19 +194,25 @@ impl<A: IterBytes> &[A]: IterBytes { impl<A: IterBytes, B: IterBytes> (A,B): IterBytes { #[inline(always)] pure fn iter_bytes(lsb0: bool, f: Cb) { - let &(ref a, ref b) = &self; - a.iter_bytes(lsb0, f); - b.iter_bytes(lsb0, f); + match self { + (ref a, ref b) => { + a.iter_bytes(lsb0, f); + b.iter_bytes(lsb0, f); + } + } } } impl<A: IterBytes, B: IterBytes, C: IterBytes> (A,B,C): IterBytes { #[inline(always)] pure fn iter_bytes(lsb0: bool, f: Cb) { - let &(ref a, ref b, ref c) = &self; - a.iter_bytes(lsb0, f); - b.iter_bytes(lsb0, f); - c.iter_bytes(lsb0, f); + match self { + (ref a, ref b, ref c) => { + a.iter_bytes(lsb0, f); + b.iter_bytes(lsb0, f); + c.iter_bytes(lsb0, f); + } + } } } |
