Merge pull request #91 from zed-industries/fix-save

Ensure all bytes are written when saving a buffer
This commit is contained in:
Max Brunsfeld 2021-06-15 09:19:07 -07:00 committed by GitHub
commit 38891070e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -208,7 +208,7 @@ impl Worktree {
let file = fs::File::create(&abs_path)?;
let mut writer = io::BufWriter::with_capacity(buffer_size, &file);
for chunk in content.chunks() {
writer.write(chunk.as_bytes())?;
writer.write_all(chunk.as_bytes())?;
}
writer.flush()?;