Skip to content

libstd: remove redundant & from &Path::new(...) #43290

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/libstd/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions src/libstd/sys/redox/net/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down Expand Up @@ -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)> {
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/sys/redox/net/udp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/sys/redox/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
}
Expand Down