Skip to content

Commit 2e8859c

Browse files
committed
libstd: remove redundant & from &Path::new(...)
fn Path::new<S: AsRef ...>(s: &S) -> &Path Signed-off-by: NODA, Kai <[email protected]>
1 parent 5803f99 commit 2e8859c

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

src/libstd/fs.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2346,17 +2346,17 @@ mod tests {
23462346

23472347
#[test]
23482348
fn recursive_mkdir_slash() {
2349-
check!(fs::create_dir_all(&Path::new("/")));
2349+
check!(fs::create_dir_all(Path::new("/")));
23502350
}
23512351

23522352
#[test]
23532353
fn recursive_mkdir_dot() {
2354-
check!(fs::create_dir_all(&Path::new(".")));
2354+
check!(fs::create_dir_all(Path::new(".")));
23552355
}
23562356

23572357
#[test]
23582358
fn recursive_mkdir_empty() {
2359-
check!(fs::create_dir_all(&Path::new("")));
2359+
check!(fs::create_dir_all(Path::new("")));
23602360
}
23612361

23622362
#[test]

src/libstd/sys/redox/net/tcp.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ impl TcpStream {
2929
let mut options = OpenOptions::new();
3030
options.read(true);
3131
options.write(true);
32-
Ok(TcpStream(File::open(&Path::new(path.as_str()), &options)?))
32+
Ok(TcpStream(File::open(Path::new(path.as_str()), &options)?))
3333
}
3434

3535
pub fn connect_timeout(_addr: &SocketAddr, _timeout: Duration) -> Result<TcpStream> {
@@ -177,7 +177,7 @@ impl TcpListener {
177177
let mut options = OpenOptions::new();
178178
options.read(true);
179179
options.write(true);
180-
Ok(TcpListener(File::open(&Path::new(path.as_str()), &options)?))
180+
Ok(TcpListener(File::open(Path::new(path.as_str()), &options)?))
181181
}
182182

183183
pub fn accept(&self) -> Result<(TcpStream, SocketAddr)> {

src/libstd/sys/redox/net/udp.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ impl UdpSocket {
3030
let mut options = OpenOptions::new();
3131
options.read(true);
3232
options.write(true);
33-
Ok(UdpSocket(File::open(&Path::new(path.as_str()), &options)?, UnsafeCell::new(None)))
33+
Ok(UdpSocket(File::open(Path::new(path.as_str()), &options)?, UnsafeCell::new(None)))
3434
}
3535

3636
fn get_conn(&self) -> &mut Option<SocketAddr> {

src/libstd/sys/redox/process.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ impl Stdio {
393393
let mut opts = OpenOptions::new();
394394
opts.read(readable);
395395
opts.write(!readable);
396-
let fd = File::open(&Path::new("null:"), &opts)?;
396+
let fd = File::open(Path::new("null:"), &opts)?;
397397
Ok((ChildStdio::Owned(fd.into_fd()), None))
398398
}
399399
}

0 commit comments

Comments
 (0)