Implement IterBytes for Rc<T>.

This commit is contained in:
Léo Testard 2013-11-25 19:47:09 +01:00
parent b6ab4f2485
commit ae836c1e44

View File

@ -18,6 +18,7 @@ use cast;
use container::Container;
use iter::Iterator;
use option::{None, Option, Some};
use rc::Rc;
use str::{Str, StrSlice};
use vec::{Vector, ImmutableVector};
@ -325,6 +326,13 @@ impl<A:IterBytes> IterBytes for @mut A {
}
}
impl<A:IterBytes> IterBytes for Rc<A> {
#[inline]
fn iter_bytes(&self, lsb0: bool, f: Cb) -> bool {
self.borrow().iter_bytes(lsb0, f)
}
}
impl<A:IterBytes> IterBytes for ~A {
#[inline]
fn iter_bytes(&self, lsb0: bool, f: Cb) -> bool {