libcore/to_bytes.rs: fix IterBytes instances for pairs, triples to not cause ICE when used
This commit is contained in:
parent
d718bc292d
commit
ef2c404e01
1 changed files with 13 additions and 7 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue