mirror of
https://github.com/rust-lang/rust.git
synced 2025-11-17 08:46:45 +00:00
Remove & from Command::args calls in documentation
Now that arrays implement `IntoIterator`, using `&` is no longer necessary. This makes examples easier to understand.
This commit is contained in:
parent
81c1d7a150
commit
18715c0753
@ -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");
|
||||
/// ```
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user