]> git.lizzy.rs Git - rust.git/commitdiff
libstd: remove redundant & from &Path::new(...)
authorNODA, Kai <nodakai@gmail.com>
Mon, 17 Jul 2017 16:04:46 +0000 (00:04 +0800)
committerNODA, Kai <nodakai@gmail.com>
Mon, 17 Jul 2017 16:07:09 +0000 (00:07 +0800)
fn Path::new<S: AsRef ...>(s: &S) -> &Path

Signed-off-by: NODA, Kai <nodakai@gmail.com>
src/libstd/fs.rs
src/libstd/sys/redox/net/tcp.rs
src/libstd/sys/redox/net/udp.rs
src/libstd/sys/redox/process.rs

index 88994b284c90dced81a4592873f405756d2c82d6..38d3312b4e7dd6a7569cdd5381de742edc8e538e 100644 (file)
@@ -2346,17 +2346,17 @@ fn concurrent_recursive_mkdir() {
 
     #[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]
index 98ec3aa3e295986bc366d1302f22919a9f88b673..319965ab3965e21646216d88dad3b4b6a4cdb7ec 100644 (file)
@@ -29,7 +29,7 @@ pub fn connect(addr: &SocketAddr) -> Result<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 @@ pub fn bind(addr: &SocketAddr) -> Result<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)> {
index 93ebcc95fd0f87e0c70fa6584678ec2cab778a8a..7e7666e7ef3641b43ccced4bea02bdc11d1c37c2 100644 (file)
@@ -30,7 +30,7 @@ pub fn bind(addr: &SocketAddr) -> Result<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> {
index 62d873d257d8ffcd7651af05640a1266b667d5b1..ffa6bf0fa3ed14feb90bc224bf8f16b23edd5645 100644 (file)
@@ -393,7 +393,7 @@ fn to_child_stdio(&self, readable: bool)
                 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))
             }
         }