Skip to content

Commit f8d12dc

Browse files
authored
Rollup merge of rust-lang#64294 - wchargin:wchargin-stdio-piped-docs, r=Dylan-DPC
Fix `Stdio::piped` example code and lint Summary: Invoking `rev` does not add a trailing newline when none is present in the input (at least on my Debian). Nearby examples use `echo` rather than `rev`, which probably explains the source of the discrepancy. Also, a `mut` qualifier is unused. Test Plan: Copy the code block into <https://play.rust-lang.org> with a `fn main` wrapper, and run it. Note that it compiles and runs cleanly; prior to this commit, it would emit an `unused_mut` warning and then panic. wchargin-branch: stdio-piped-docs
2 parents 43f291c + 9bf5773 commit f8d12dc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libstd/process.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,7 @@ impl Stdio {
940940
/// }
941941
///
942942
/// let output = child.wait_with_output().expect("Failed to read stdout");
943-
/// assert_eq!(String::from_utf8_lossy(&output.stdout), "!dlrow ,olleH\n");
943+
/// assert_eq!(String::from_utf8_lossy(&output.stdout), "!dlrow ,olleH");
944944
/// ```
945945
#[stable(feature = "process", since = "1.0.0")]
946946
pub fn piped() -> Stdio { Stdio(imp::Stdio::MakePipe) }

0 commit comments

Comments
 (0)