From dd880be3c49b8da2273059442cd8845cdceb0814 Mon Sep 17 00:00:00 2001 From: Lucy Date: Sat, 5 Oct 2024 22:57:16 -0400 Subject: [PATCH] Remove redundant flushes --- crates/file/src/lib.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/crates/file/src/lib.rs b/crates/file/src/lib.rs index 6ed4399..2d47bab 100644 --- a/crates/file/src/lib.rs +++ b/crates/file/src/lib.rs @@ -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(()) }; @@ -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(()) };