Skip to content

Commit ae836c1

Browse files
committed
Implement IterBytes for Rc<T>.
1 parent b6ab4f2 commit ae836c1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/libstd/to_bytes.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ use cast;
1818
use container::Container;
1919
use iter::Iterator;
2020
use option::{None, Option, Some};
21+
use rc::Rc;
2122
use str::{Str, StrSlice};
2223
use vec::{Vector, ImmutableVector};
2324

@@ -325,6 +326,13 @@ impl<A:IterBytes> IterBytes for @mut A {
325326
}
326327
}
327328

329+
impl<A:IterBytes> IterBytes for Rc<A> {
330+
#[inline]
331+
fn iter_bytes(&self, lsb0: bool, f: Cb) -> bool {
332+
self.borrow().iter_bytes(lsb0, f)
333+
}
334+
}
335+
328336
impl<A:IterBytes> IterBytes for ~A {
329337
#[inline]
330338
fn iter_bytes(&self, lsb0: bool, f: Cb) -> bool {

0 commit comments

Comments
 (0)