Skip to content

Commit 7027b0f

Browse files
Remove & from Command::args calls in documentation
Now that arrays implement `IntoIterator`, using `&` is no longer necessary. This makes examples easier to understand.
1 parent a11cf6d commit 7027b0f

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
@@ -451,7 +451,7 @@ impl fmt::Debug for ChildStderr {
451451
///
452452
/// let output = if cfg!(target_os = "windows") {
453453
/// Command::new("cmd")
454-
/// .args(&["/C", "echo hello"])
454+
/// .args(["/C", "echo hello"])
455455
/// .output()
456456
/// .expect("failed to execute process")
457457
/// } else {
@@ -608,7 +608,7 @@ impl Command {
608608
/// use std::process::Command;
609609
///
610610
/// Command::new("ls")
611-
/// .args(&["-l", "-a"])
611+
/// .args(["-l", "-a"])
612612
/// .spawn()
613613
/// .expect("ls command failed to start");
614614
/// ```

0 commit comments

Comments
 (0)