mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-12 08:36:03 +00:00
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
@ -194,20 +194,26 @@ impl<A: IterBytes> &[A]: IterBytes {
|
|||||||
impl<A: IterBytes, B: IterBytes> (A,B): IterBytes {
|
impl<A: IterBytes, B: IterBytes> (A,B): IterBytes {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pure fn iter_bytes(lsb0: bool, f: Cb) {
|
pure fn iter_bytes(lsb0: bool, f: Cb) {
|
||||||
let &(ref a, ref b) = &self;
|
match self {
|
||||||
|
(ref a, ref b) => {
|
||||||
a.iter_bytes(lsb0, f);
|
a.iter_bytes(lsb0, f);
|
||||||
b.iter_bytes(lsb0, f);
|
b.iter_bytes(lsb0, f);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<A: IterBytes, B: IterBytes, C: IterBytes> (A,B,C): IterBytes {
|
impl<A: IterBytes, B: IterBytes, C: IterBytes> (A,B,C): IterBytes {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pure fn iter_bytes(lsb0: bool, f: Cb) {
|
pure fn iter_bytes(lsb0: bool, f: Cb) {
|
||||||
let &(ref a, ref b, ref c) = &self;
|
match self {
|
||||||
|
(ref a, ref b, ref c) => {
|
||||||
a.iter_bytes(lsb0, f);
|
a.iter_bytes(lsb0, f);
|
||||||
b.iter_bytes(lsb0, f);
|
b.iter_bytes(lsb0, f);
|
||||||
c.iter_bytes(lsb0, f);
|
c.iter_bytes(lsb0, f);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Move this to vec, probably.
|
// Move this to vec, probably.
|
||||||
|
Loading…
Reference in New Issue
Block a user