mirror of
https://github.com/tokio-rs/bytes.git
synced 2026-08-19 00:00:12 +02:00
no need to be marked mutable
allows code to compile with nightly again.
This commit is contained in:
+2
-2
@@ -48,7 +48,7 @@ pub trait Buf {
|
|||||||
let len = cmp::min(dst.len(), self.remaining());
|
let len = cmp::min(dst.len(), self.remaining());
|
||||||
|
|
||||||
while off < len {
|
while off < len {
|
||||||
let mut cnt;
|
let cnt;
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
let src = self.bytes();
|
let src = self.bytes();
|
||||||
@@ -127,7 +127,7 @@ pub trait MutBuf : Sized {
|
|||||||
let len = cmp::min(src.len(), self.remaining());
|
let len = cmp::min(src.len(), self.remaining());
|
||||||
|
|
||||||
while off < len {
|
while off < len {
|
||||||
let mut cnt;
|
let cnt;
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
let dst = self.mut_bytes();
|
let dst = self.mut_bytes();
|
||||||
|
|||||||
+4
-4
@@ -21,8 +21,8 @@ impl Bytes {
|
|||||||
pub fn of<B: ByteStr>(bytes: B) -> Bytes {
|
pub fn of<B: ByteStr>(bytes: B) -> Bytes {
|
||||||
unsafe {
|
unsafe {
|
||||||
if inline::<B>() {
|
if inline::<B>() {
|
||||||
let mut vtable;
|
let vtable;
|
||||||
let mut data;
|
let data;
|
||||||
|
|
||||||
{
|
{
|
||||||
let obj: &ByteStrPriv = &bytes;
|
let obj: &ByteStrPriv = &bytes;
|
||||||
@@ -78,7 +78,7 @@ impl Bytes {
|
|||||||
if TypeId::of::<B>() == self.obj().get_type_id() {
|
if TypeId::of::<B>() == self.obj().get_type_id() {
|
||||||
unsafe {
|
unsafe {
|
||||||
// Underlying ByteStr value is of the correct type. Unwrap it
|
// Underlying ByteStr value is of the correct type. Unwrap it
|
||||||
let mut ret;
|
let ret;
|
||||||
|
|
||||||
if inline::<B>() {
|
if inline::<B>() {
|
||||||
// The value is inline, read directly from the pointer
|
// The value is inline, read directly from the pointer
|
||||||
@@ -206,7 +206,7 @@ impl<'a> Source for &'a Bytes {
|
|||||||
let mut res = 0;
|
let mut res = 0;
|
||||||
|
|
||||||
while src.has_remaining() && dst.has_remaining() {
|
while src.has_remaining() && dst.has_remaining() {
|
||||||
let mut l;
|
let l;
|
||||||
|
|
||||||
{
|
{
|
||||||
let s = src.bytes();
|
let s = src.bytes();
|
||||||
|
|||||||
Reference in New Issue
Block a user