From 30c0126955fc4d9212d5bcd150b481b570db541c Mon Sep 17 00:00:00 2001 From: bisho Date: Mon, 4 Mar 2024 18:05:25 +0100 Subject: [PATCH] Initialize vector with capacity 128 to avoid reallocs (#3) --- Cargo.toml | 2 +- src/impl_build_cmd.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 0f41a50..7c09d36 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "meta-memcache-socket" -version = "0.1.1" +version = "0.1.2" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/src/impl_build_cmd.rs b/src/impl_build_cmd.rs index 0409055..2fa3c0d 100644 --- a/src/impl_build_cmd.rs +++ b/src/impl_build_cmd.rs @@ -30,7 +30,7 @@ pub fn impl_build_cmd( } // Build the command - let mut buf: Vec = Vec::new(); + let mut buf: Vec = Vec::with_capacity(128); // Add CMD buf.extend_from_slice(cmd);