Skip to content

Commit 8706176

Browse files
author
Devdutt Shenoi
committed
refactor: retire DiskWriter::finish
1 parent fd82d8c commit 8706176

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/parseable/staging/writer.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,11 @@ impl DiskWriter {
6969
pub fn write(&mut self, rb: &RecordBatch) -> Result<(), StagingError> {
7070
self.inner.write(rb).map_err(StagingError::Arrow)
7171
}
72+
}
7273

74+
impl Drop for DiskWriter {
7375
/// Write the continuation bytes and mark the file as done, rename to `.data.arrows`
74-
pub fn finish(&mut self) {
76+
fn drop(&mut self) {
7577
if let Err(err) = self.inner.finish() {
7678
error!("Couldn't finish arrow file {:?}, error = {err}", self.path);
7779
return;
@@ -85,12 +87,6 @@ impl DiskWriter {
8587
}
8688
}
8789

88-
impl Drop for DiskWriter {
89-
fn drop(&mut self) {
90-
self.finish();
91-
}
92-
}
93-
9490
/// Structure to keep recordbatches in memory.
9591
///
9692
/// Any new schema is updated in the schema map.

0 commit comments

Comments
 (0)