about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMark Simulacrum <mark.simulacrum@gmail.com>2017-07-18 09:41:32 -0600
committerGitHub <noreply@github.com>2017-07-18 09:41:32 -0600
commit751c6e2b4c36081a600ce748f208ac71839abe78 (patch)
treea06af36d12a6d48367873a58b0e041f5c3f39fab
parent6a566710c59c28891d367e0ce721f278b824aa25 (diff)
parent2e8859ce4e97df8e2b1372e20efe4f8676c0f178 (diff)
downloadrust-751c6e2b4c36081a600ce748f208ac71839abe78.tar.gz
rust-751c6e2b4c36081a600ce748f208ac71839abe78.zip
Rollup merge of #43290 - nodakai:fix-ref-path-new, r=Mark-Simulacrum
libstd: remove redundant & from &Path::new(...)

```rust
fn Path::new<S: AsRef ...>(s: &S) -> &Path
```

* https://doc.rust-lang.org/std/path/struct.Path.html#method.new
-rw-r--r--src/libstd/fs.rs6
-rw-r--r--src/libstd/sys/redox/net/tcp.rs4
-rw-r--r--src/libstd/sys/redox/net/udp.rs2
-rw-r--r--src/libstd/sys/redox/process.rs2
4 files changed, 7 insertions, 7 deletions
diff --git a/src/libstd/fs.rs b/src/libstd/fs.rs
index 88994b284c9..38d3312b4e7 100644
--- a/src/libstd/fs.rs
+++ b/src/libstd/fs.rs
@@ -2346,17 +2346,17 @@ mod tests {
 
     #[test]
     fn recursive_mkdir_slash() {
-        check!(fs::create_dir_all(&Path::new("/")));
+        check!(fs::create_dir_all(Path::new("/")));
     }
 
     #[test]
     fn recursive_mkdir_dot() {
-        check!(fs::create_dir_all(&Path::new(".")));
+        check!(fs::create_dir_all(Path::new(".")));
     }
 
     #[test]
     fn recursive_mkdir_empty() {
-        check!(fs::create_dir_all(&Path::new("")));
+        check!(fs::create_dir_all(Path::new("")));
     }
 
     #[test]
diff --git a/src/libstd/sys/redox/net/tcp.rs b/src/libstd/sys/redox/net/tcp.rs
index 98ec3aa3e29..319965ab396 100644
--- a/src/libstd/sys/redox/net/tcp.rs
+++ b/src/libstd/sys/redox/net/tcp.rs
@@ -29,7 +29,7 @@ impl TcpStream {
         let mut options = OpenOptions::new();
         options.read(true);
         options.write(true);
-        Ok(TcpStream(File::open(&Path::new(path.as_str()), &options)?))
+        Ok(TcpStream(File::open(Path::new(path.as_str()), &options)?))
     }
 
     pub fn connect_timeout(_addr: &SocketAddr, _timeout: Duration) -> Result<TcpStream> {
@@ -177,7 +177,7 @@ impl TcpListener {
         let mut options = OpenOptions::new();
         options.read(true);
         options.write(true);
-        Ok(TcpListener(File::open(&Path::new(path.as_str()), &options)?))
+        Ok(TcpListener(File::open(Path::new(path.as_str()), &options)?))
     }
 
     pub fn accept(&self) -> Result<(TcpStream, SocketAddr)> {
diff --git a/src/libstd/sys/redox/net/udp.rs b/src/libstd/sys/redox/net/udp.rs
index 93ebcc95fd0..7e7666e7ef3 100644
--- a/src/libstd/sys/redox/net/udp.rs
+++ b/src/libstd/sys/redox/net/udp.rs
@@ -30,7 +30,7 @@ impl UdpSocket {
         let mut options = OpenOptions::new();
         options.read(true);
         options.write(true);
-        Ok(UdpSocket(File::open(&Path::new(path.as_str()), &options)?, UnsafeCell::new(None)))
+        Ok(UdpSocket(File::open(Path::new(path.as_str()), &options)?, UnsafeCell::new(None)))
     }
 
     fn get_conn(&self) -> &mut Option<SocketAddr> {
diff --git a/src/libstd/sys/redox/process.rs b/src/libstd/sys/redox/process.rs
index 62d873d257d..ffa6bf0fa3e 100644
--- a/src/libstd/sys/redox/process.rs
+++ b/src/libstd/sys/redox/process.rs
@@ -393,7 +393,7 @@ impl Stdio {
                 let mut opts = OpenOptions::new();
                 opts.read(readable);
                 opts.write(!readable);
-                let fd = File::open(&Path::new("null:"), &opts)?;
+                let fd = File::open(Path::new("null:"), &opts)?;
                 Ok((ChildStdio::Owned(fd.into_fd()), None))
             }
         }