std: Use do
blocks instead of for
with .iter_bytes()
This commit is contained in:
parent
18d124b9b5
commit
6d7a0c8cbc
2 changed files with 49 additions and 33 deletions
|
@ -353,9 +353,10 @@ pub trait ToBytes {
|
|||
impl<A:IterBytes> ToBytes for A {
|
||||
fn to_bytes(&self, lsb0: bool) -> ~[u8] {
|
||||
do io::with_bytes_writer |wr| {
|
||||
for self.iter_bytes(lsb0) |bytes| {
|
||||
wr.write(bytes)
|
||||
}
|
||||
do self.iter_bytes(lsb0) |bytes| {
|
||||
wr.write(bytes);
|
||||
true
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue