From 18715c0753701df29a91c1bf7fb2d010a2a92cd5 Mon Sep 17 00:00:00 2001 From: Konrad Borowski Date: Fri, 2 Jul 2021 11:10:00 +0200 Subject: [PATCH] Remove & from Command::args calls in documentation Now that arrays implement `IntoIterator`, using `&` is no longer necessary. This makes examples easier to understand. --- library/std/src/process.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/std/src/process.rs b/library/std/src/process.rs index f9cfd11e906..c433e74faf3 100644 --- a/library/std/src/process.rs +++ b/library/std/src/process.rs @@ -451,7 +451,7 @@ impl fmt::Debug for ChildStderr { /// /// let output = if cfg!(target_os = "windows") { /// Command::new("cmd") -/// .args(&["/C", "echo hello"]) +/// .args(["/C", "echo hello"]) /// .output() /// .expect("failed to execute process") /// } else { @@ -608,7 +608,7 @@ impl Command { /// use std::process::Command; /// /// Command::new("ls") - /// .args(&["-l", "-a"]) + /// .args(["-l", "-a"]) /// .spawn() /// .expect("ls command failed to start"); /// ```