Skip to content

Commit

Permalink
fix(lint): no need for write(true) when we've append(true)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronArinder committed May 30, 2024
1 parent cbb12a3 commit d3a59bc
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions installers/binstall/src/system/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ pub fn add_binary_to_path(installer: &Installer) -> Result<(), InstallerError> {
for rc in shell.update_rcs() {
if !rc.is_file() || !fs::read_to_string(&rc)?.contains(&source_cmd) {
tracing::debug!("updating {}", &rc);
let mut dest_file = fs::OpenOptions::new()
.write(true)
.append(true)
.create(true)
.open(&rc)?;
let mut dest_file = fs::OpenOptions::new().append(true).create(true).open(&rc)?;
writeln!(&mut dest_file, "{}", &source_cmd)?;
dest_file.sync_data()?;
}
Expand Down

0 comments on commit d3a59bc

Please sign in to comment.