mirror of
https://github.com/tokio-rs/bytes.git
synced 2026-08-14 00:00:13 +02:00
Fix errors and warnings with current rust nightly
This commit is contained in:
+1
-2
@@ -1,7 +1,6 @@
|
||||
use {alloc, Bytes, SeqByteStr, MAX_CAPACITY};
|
||||
use traits::{Buf, MutBuf, MutBufExt, ByteStr};
|
||||
use std::{cmp, ptr};
|
||||
use std::num::UnsignedInt;
|
||||
|
||||
/*
|
||||
*
|
||||
@@ -57,7 +56,7 @@ impl ByteBuf {
|
||||
}
|
||||
|
||||
// Round the capacity to the closest power of 2
|
||||
capacity = UnsignedInt::next_power_of_two(capacity);
|
||||
capacity = capacity.next_power_of_two();
|
||||
|
||||
// Allocate the memory
|
||||
let mem = alloc::HEAP.allocate(capacity as usize);
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
#![crate_name = "bytes"]
|
||||
#![unstable]
|
||||
|
||||
#![feature(alloc, core, io, unsafe_no_drop_flag)]
|
||||
#![feature(alloc, core, unsafe_no_drop_flag)]
|
||||
|
||||
pub use byte_buf::{ByteBuf, ROByteBuf, MutByteBuf};
|
||||
pub use byte_str::{SeqByteStr, SmallByteStr, SmallByteStrBuf};
|
||||
|
||||
+1
-2
@@ -1,6 +1,5 @@
|
||||
use super::{Buf, MutBuf};
|
||||
use std::{cmp, fmt, mem, ptr, slice};
|
||||
use std::num::UnsignedInt;
|
||||
use std::rt::heap;
|
||||
|
||||
/// Buf backed by a continous chunk of memory. Maintains a read cursor and a
|
||||
@@ -27,7 +26,7 @@ impl RingBuf {
|
||||
}
|
||||
|
||||
// Round to the next power of 2 for better alignment
|
||||
capacity = UnsignedInt::next_power_of_two(capacity);
|
||||
capacity = capacity.next_power_of_two();
|
||||
|
||||
// Allocate the memory
|
||||
let ptr = unsafe { heap::allocate(capacity, mem::min_align_of::<u8>()) };
|
||||
|
||||
Reference in New Issue
Block a user