Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

clippy: Removes ineffective open options #34599

Merged
merged 1 commit into from
Dec 28, 2023
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
1 change: 0 additions & 1 deletion install/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,6 @@ fn add_to_path(new_path: &str) -> bool {
fn append_file(dest: &Path, line: &str) -> io::Result<()> {
use std::io::Write;
let mut dest_file = fs::OpenOptions::new()
.write(true)
.append(true)
.create(true)
.open(dest)?;
Expand Down
1 change: 0 additions & 1 deletion logger/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ pub fn setup() {
pub fn setup_file_with_default(logfile: &str, filter: &str) {
use std::fs::OpenOptions;
let file = OpenOptions::new()
.write(true)
.create(true)
.append(true)
.open(logfile)
Expand Down
7 changes: 1 addition & 6 deletions validator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,7 @@ pub mod dashboard;
#[cfg(unix)]
fn redirect_stderr(filename: &str) {
use std::os::unix::io::AsRawFd;
match OpenOptions::new()
.write(true)
.create(true)
.append(true)
.open(filename)
{
match OpenOptions::new().create(true).append(true).open(filename) {
Ok(file) => unsafe {
libc::dup2(file.as_raw_fd(), libc::STDERR_FILENO);
},
Expand Down