From 8d6c2b61cce6941a7dc35f15be421bf1d62425b0 Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Fri, 15 Dec 2017 18:10:30 -0600 Subject: [PATCH] Document correct inline capacity in bytes.rs (#171) Fixes #164 --- src/bytes.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bytes.rs b/src/bytes.rs index 34451b1..dea63e2 100644 --- a/src/bytes.rs +++ b/src/bytes.rs @@ -386,7 +386,7 @@ impl Bytes { /// Creates a new `Bytes` with the specified capacity. /// /// The returned `Bytes` will be able to hold at least `capacity` bytes - /// without reallocating. If `capacity` is under `3 * size_of::()`, + /// without reallocating. If `capacity` is under `4 * size_of::() - 1`, /// then `BytesMut` will not allocate. /// /// It is important to note that this function does not specify the length @@ -985,7 +985,7 @@ impl BytesMut { /// Creates a new `BytesMut` with the specified capacity. /// /// The returned `BytesMut` will be able to hold at least `capacity` bytes - /// without reallocating. If `capacity` is under `3 * size_of::()`, + /// without reallocating. If `capacity` is under `4 * size_of::() - 1`, /// then `BytesMut` will not allocate. /// /// It is important to note that this function does not specify the length