diff options
| author | Léo Testard <leo.testard@gmail.com> | 2013-11-25 19:47:09 +0100 |
|---|---|---|
| committer | Léo Testard <leo.testard@gmail.com> | 2013-11-25 19:47:09 +0100 |
| commit | ae836c1e44d7459d4588e622a8535f127e32716f (patch) | |
| tree | 6de2a5badcb2f2ce81d9c932be19e2e8ba546304 /src/libstd/to_bytes.rs | |
| parent | b6ab4f2485c5e4bc6c18868c4e4c522404f77b20 (diff) | |
| download | rust-ae836c1e44d7459d4588e622a8535f127e32716f.tar.gz rust-ae836c1e44d7459d4588e622a8535f127e32716f.zip | |
Implement IterBytes for Rc<T>.
Diffstat (limited to 'src/libstd/to_bytes.rs')
| -rw-r--r-- | src/libstd/to_bytes.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libstd/to_bytes.rs b/src/libstd/to_bytes.rs index 8b424c53be0..28b79bdd320 100644 --- a/src/libstd/to_bytes.rs +++ b/src/libstd/to_bytes.rs @@ -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 { |
