Skip to content

Commit

Permalink
Make MultiValue::with_capacity public
Browse files Browse the repository at this point in the history
  • Loading branch information
khvzak committed Aug 5, 2024
1 parent aa47324 commit f0a995a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -792,13 +792,13 @@ impl DerefMut for MultiValue {

impl MultiValue {
/// Creates an empty `MultiValue` containing no values.
#[inline]
pub fn new() -> MultiValue {
Self::with_capacity(0)
}

/// Similar to `new` but can reuse previously used container with allocated capacity.
#[inline]
pub(crate) fn with_capacity(capacity: usize) -> MultiValue {
/// Creates an empty `MultiValue` container with space for at least `capacity` elements.
pub fn with_capacity(capacity: usize) -> MultiValue {
let deque = MULTIVALUE_POOL.with_borrow_mut(|pool| {
pool.pop().map_or_else(
|| VecDeque::with_capacity(capacity),
Expand Down

0 comments on commit f0a995a

Please sign in to comment.