From 91e5063bc85dc66522c32075a2c9e1a8b879e420 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Thu, 13 Nov 2025 00:57:51 +0300 Subject: [PATCH] eh: replace magic buffer sizes Signed-off-by: NotAShelf Change-Id: Ifc24f3945763d75c58450e62b5ec701e6a6a6964 --- eh/src/command.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/eh/src/command.rs b/eh/src/command.rs index 4e314fd..6589518 100644 --- a/eh/src/command.rs +++ b/eh/src/command.rs @@ -21,6 +21,9 @@ impl LogInterceptor for StdIoInterceptor { } } +/// Default buffer size for reading command output +const DEFAULT_BUFFER_SIZE: usize = 4096; + /// Builder and executor for Nix commands. pub struct NixCommand { subcommand: String, @@ -119,8 +122,8 @@ impl NixCommand { let mut stdout = child_stdout; let mut stderr = child_stderr; - let mut out_buf = [0u8; 4096]; - let mut err_buf = [0u8; 4096]; + let mut out_buf = [0u8; DEFAULT_BUFFER_SIZE]; + let mut err_buf = [0u8; DEFAULT_BUFFER_SIZE]; let mut out_queue = VecDeque::new(); let mut err_queue = VecDeque::new();