From d8adc2216a29885df8440b9bfdc304f10ca17204 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Fri, 7 Jun 2024 15:49:38 -0400 Subject: [PATCH] cmd: Note trailing newlines are trimmed This is very important and useful behavior, and worth documenting. --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 1ffa36d..a54f9a5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -966,12 +966,12 @@ impl<'a> Cmd<'a> { self.output_impl(false, false).map(|_| ()) } - /// Run the command and return its stdout as a string. + /// Run the command and return its stdout as a string. Any trailing newline or carriage return will be trimmed. pub fn read(&self) -> Result { self.read_stream(false) } - /// Run the command and return its stderr as a string. + /// Run the command and return its stderr as a string. Any trailing newline or carriage return will be trimmed. pub fn read_stderr(&self) -> Result { self.read_stream(true) }