fix: use write_all instead of write

pull/24376/head
Jake Goulding 2022-11-18 10:36:36 -05:00 committed by Carol (Nichols || Goulding)
parent b96de5983d
commit 651b7a1ce6
No known key found for this signature in database
GPG Key ID: E907EE5A736F87D4
1 changed files with 4 additions and 3 deletions

View File

@ -385,12 +385,13 @@ impl SegmentFile {
.open(&path)
.await
.context(SegmentCreateSnafu)?;
let bytes_written = f
.write(FILE_TYPE_IDENTIFIER)
f.write_all(FILE_TYPE_IDENTIFIER)
.await
.context(SegmentWriteSnafu)?;
let bytes_written = FILE_TYPE_IDENTIFIER.len();
let id_bytes = id.as_bytes();
let id_bytes_written = f.write(id_bytes).await.context(SegmentWriteSnafu)?;
f.write_all(id_bytes).await.context(SegmentWriteSnafu)?;
let id_bytes_written = id_bytes.len();
f.sync_all().await.context(SegmentWriteSnafu)?;