about summary refs log tree commit diff
path: root/library/std/src
diff options
context:
space:
mode:
authorYuki Okushi <jtitor@2k36.org>2021-07-03 03:15:12 +0900
committerGitHub <noreply@github.com>2021-07-03 03:15:12 +0900
commit61073404830412169c20cc48f49fff34aa4bbc9f (patch)
tree62628e3e8e4c2dea7634635a2302cb0182b49ce9 /library/std/src
parentf6ef2c8cbed2c119a2b7cc81baee52a4256b09bf (diff)
parent18715c0753701df29a91c1bf7fb2d010a2a92cd5 (diff)
downloadrust-61073404830412169c20cc48f49fff34aa4bbc9f.tar.gz
rust-61073404830412169c20cc48f49fff34aa4bbc9f.zip
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.
Diffstat (limited to 'library/std/src')
-rw-r--r--library/std/src/process.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/library/std/src/process.rs b/library/std/src/process.rs
index e6f8b9cfcc7..b46d3dfc1e7 100644
--- a/library/std/src/process.rs
+++ b/library/std/src/process.rs
@@ -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");
     /// ```