mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-10 20:29:05 +00:00
Ensure all bytes are written when saving a buffer
This commit is contained in:
parent
ba29b1d96d
commit
37cc1e8e83
1 changed files with 1 additions and 1 deletions
|
@ -208,7 +208,7 @@ impl Worktree {
|
||||||
let file = fs::File::create(&abs_path)?;
|
let file = fs::File::create(&abs_path)?;
|
||||||
let mut writer = io::BufWriter::with_capacity(buffer_size, &file);
|
let mut writer = io::BufWriter::with_capacity(buffer_size, &file);
|
||||||
for chunk in content.chunks() {
|
for chunk in content.chunks() {
|
||||||
writer.write(chunk.as_bytes())?;
|
writer.write_all(chunk.as_bytes())?;
|
||||||
}
|
}
|
||||||
writer.flush()?;
|
writer.flush()?;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue