Skip to content

Commit

Permalink
Remove redundant flushes
Browse files Browse the repository at this point in the history
  • Loading branch information
Absolucy committed Oct 6, 2024
1 parent de4fa5b commit dd880be
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions crates/file/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ pub fn file_write(path: PathBuf, data: String) -> bool {
}
let mut file = File::create(path).ok().map(BufWriter::new)?;
file.write_all(data.as_bytes()).ok()?;
file.flush().ok()?;
file.into_inner().ok()?.sync_all().ok()?;
Some(())
};
Expand All @@ -57,7 +56,6 @@ pub fn file_append(path: PathBuf, data: String) -> bool {
.ok()
.map(BufWriter::new)?;
file.write_all(data.as_bytes()).ok()?;
file.flush().ok()?;
file.into_inner().ok()?.sync_all().ok()?;
Some(())
};
Expand Down

0 comments on commit dd880be

Please sign in to comment.