Skip to content

Commit d3e481c

Browse files
JohnTitorgitbot
authored and
gitbot
committed
Rollup merge of rust-lang#86803 - xfix:remove-unnecessary-ampersand-from-command-args-calls, r=joshtriplett
Remove & from Command::args calls in documentation Now that arrays implement `IntoIterator`, using `&` is no longer necessary. This makes examples easier to understand.
2 parents 0f68383 + 7027b0f commit d3e481c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

std/src/process.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ impl fmt::Debug for ChildStderr {
452452
///
453453
/// let output = if cfg!(target_os = "windows") {
454454
/// Command::new("cmd")
455-
/// .args(&["/C", "echo hello"])
455+
/// .args(["/C", "echo hello"])
456456
/// .output()
457457
/// .expect("failed to execute process")
458458
/// } else {
@@ -609,7 +609,7 @@ impl Command {
609609
/// use std::process::Command;
610610
///
611611
/// Command::new("ls")
612-
/// .args(&["-l", "-a"])
612+
/// .args(["-l", "-a"])
613613
/// .spawn()
614614
/// .expect("ls command failed to start");
615615
/// ```

0 commit comments

Comments
 (0)