Rollup merge of #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.
This commit is contained in:
Yuki Okushi 2021-07-03 03:15:12 +09:00 committed by GitHub
commit 6107340483
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -452,7 +452,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 {
@ -609,7 +609,7 @@ impl Command {
/// use std::process::Command;
///
/// Command::new("ls")
/// .args(&["-l", "-a"])
/// .args(["-l", "-a"])
/// .spawn()
/// .expect("ls command failed to start");
/// ```