From 4b2e84de2dd6d55375e099ba252287c62f2378c4 Mon Sep 17 00:00:00 2001 From: oech3 <79379754+oech3@users.noreply.github.com> Date: Mon, 30 Mar 2026 20:40:48 +0900 Subject: [PATCH] stdbuf: use .with_capacity for Vec storing searched paths --- src/uu/stdbuf/src/stdbuf.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/uu/stdbuf/src/stdbuf.rs b/src/uu/stdbuf/src/stdbuf.rs index 60a7206a6..f8927967d 100644 --- a/src/uu/stdbuf/src/stdbuf.rs +++ b/src/uu/stdbuf/src/stdbuf.rs @@ -154,7 +154,7 @@ fn get_preload_env(_tmp_dir: &TempDir) -> UResult<(String, PathBuf)> { // Search paths in order: // 1. Directory where stdbuf is located (program_path) // 2. Compile-time directory from LIBSTDBUF_DIR - let mut search_paths: Vec = Vec::new(); + let mut search_paths: Vec = Vec::with_capacity(2); // First, try to get the directory where stdbuf is running from if let Ok(exe_path) = std::env::current_exe() {