Skip to content

Commit

Permalink
Flush files
Browse files Browse the repository at this point in the history
  • Loading branch information
melody-rs committed Jul 16, 2024
1 parent be5d04a commit 436a648
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions crates/ui/src/windows/config_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ where
OpenFlags::Write | OpenFlags::Truncate | OpenFlags::Create,
)?;
file.write_all(write_buf).await?;
file.flush().await?;

from.remove_file(host, filename)?;

Expand Down Expand Up @@ -155,11 +156,12 @@ where

to.write_data_to(&data, write_buf)?;

let mut map_file = host.open_file(
let mut file = host.open_file(
to.path_for(filename),
OpenFlags::Write | OpenFlags::Truncate | OpenFlags::Create,
)?;
map_file.write_all(write_buf).await?;
file.write_all(write_buf).await?;
file.flush().await?;

from.remove_file(host, filename)?;

Expand Down

0 comments on commit 436a648

Please sign in to comment.