From 3ca009577b655f9059ba4ec8208c1b39869260ac Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Sun, 19 Jun 2016 21:32:18 +0100 Subject: [PATCH] Bytes reader should be Send --- src/buf/mod.rs | 6 +++--- src/str/bytes.rs | 8 ++++---- src/str/mod.rs | 2 +- src/str/rope.rs | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/buf/mod.rs b/src/buf/mod.rs index b52e99a..1ce2c00 100644 --- a/src/buf/mod.rs +++ b/src/buf/mod.rs @@ -295,7 +295,7 @@ impl WriteExt for T { * */ -impl Buf for Box { +impl Buf for Box { fn remaining(&self) -> usize { (**self).remaining() } @@ -313,7 +313,7 @@ impl Buf for Box { } } -impl fmt::Debug for Box { +impl fmt::Debug for Box { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { write!(fmt, "Box {{ remaining: {} }}", self.remaining()) } @@ -409,7 +409,7 @@ macro_rules! impl_read { impl_read!(ByteBuf); impl_read!(ROByteBuf); impl_read!(RopeBuf); -impl_read!(Box); +impl_read!(Box); macro_rules! impl_write { ($ty:ty) => { diff --git a/src/str/bytes.rs b/src/str/bytes.rs index 902e930..1266757 100644 --- a/src/str/bytes.rs +++ b/src/str/bytes.rs @@ -132,9 +132,9 @@ fn inline() -> bool { impl ByteStr for Bytes { - type Buf = Box; + type Buf = Box; - fn buf(&self) -> Box { + fn buf(&self) -> Box { self.obj().buf() } @@ -200,7 +200,7 @@ unsafe impl Sync for Bytes { } trait ByteStrPriv { - fn buf(&self) -> Box; + fn buf(&self) -> Box; fn clone(&self) -> Bytes; @@ -221,7 +221,7 @@ trait ByteStrPriv { impl ByteStrPriv for B { - fn buf(&self) -> Box { + fn buf(&self) -> Box { Box::new(self.buf()) } diff --git a/src/str/mod.rs b/src/str/mod.rs index 0a830a7..9065c26 100644 --- a/src/str/mod.rs +++ b/src/str/mod.rs @@ -18,7 +18,7 @@ use std::any::Any; pub trait ByteStr : Clone + Sized + Send + Sync + Any + ToBytes + ops::Index + 'static { // Until HKT lands, the buf must be bound by 'static - type Buf: Buf+'static; + type Buf: Buf+Send+'static; /// Returns a read-only `Buf` for accessing the byte contents of the /// `ByteStr`. diff --git a/src/str/rope.rs b/src/str/rope.rs index d379855..ec7b807 100644 --- a/src/str/rope.rs +++ b/src/str/rope.rs @@ -294,7 +294,7 @@ pub struct RopeBuf { // escape (which it shouldn't) it is safe. Doing this properly would // require HKT. pieces: PieceIter<'static>, - leaf_buf: Option>, + leaf_buf: Option>, } impl RopeBuf {