mirror of
https://github.com/tokio-rs/bytes.git
synced 2026-08-15 00:00:18 +02:00
Rename RingBuf::new -> with_capacity
This commit is contained in:
+1
-1
@@ -22,7 +22,7 @@ pub struct RingBuf {
|
||||
// TODO: There are most likely many optimizations that can be made
|
||||
impl RingBuf {
|
||||
/// Allocates a new `RingBuf` with the specified capacity.
|
||||
pub fn new(mut capacity: usize) -> RingBuf {
|
||||
pub fn with_capacity(mut capacity: usize) -> RingBuf {
|
||||
// Round to the next power of 2 for better alignment
|
||||
capacity = capacity.next_power_of_two();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user