diff --git a/src/buf/mod.rs b/src/buf/mod.rs index 76a825e4fdf350e83252cc3eb678de114400f3b1..be02ee1bc0f2c45f9e225d44aff2c41d7d2aa9e4 100644 --- a/src/buf/mod.rs +++ b/src/buf/mod.rs @@ -48,7 +48,7 @@ pub trait Buf { let len = cmp::min(dst.len(), self.remaining()); while off < len { - let mut cnt; + let cnt; unsafe { let src = self.bytes(); @@ -127,7 +127,7 @@ pub trait MutBuf : Sized { let len = cmp::min(src.len(), self.remaining()); while off < len { - let mut cnt; + let cnt; unsafe { let dst = self.mut_bytes(); diff --git a/src/str/bytes.rs b/src/str/bytes.rs index 178199a5c8b964a498901640475304160b7f6f51..a0bef44a6b7e345002e52a22df450111dec02e0f 100644 --- a/src/str/bytes.rs +++ b/src/str/bytes.rs @@ -21,8 +21,8 @@ impl Bytes { pub fn of<B: ByteStr>(bytes: B) -> Bytes { unsafe { if inline::<B>() { - let mut vtable; - let mut data; + let vtable; + let data; { let obj: &ByteStrPriv = &bytes; @@ -78,7 +78,7 @@ impl Bytes { if TypeId::of::<B>() == self.obj().get_type_id() { unsafe { // Underlying ByteStr value is of the correct type. Unwrap it - let mut ret; + let ret; if inline::<B>() { // The value is inline, read directly from the pointer @@ -206,7 +206,7 @@ impl<'a> Source for &'a Bytes { let mut res = 0; while src.has_remaining() && dst.has_remaining() { - let mut l; + let l; { let s = src.bytes();