Skip to content

Commit

Permalink
[Minor]into_inner for IPC FileWriter (#1236)
Browse files Browse the repository at this point in the history
* `into_inner` for IPC `FileWriter`

* lint
  • Loading branch information
yjshen authored Jan 24, 2022
1 parent 90de247 commit ae0ad0e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions arrow/src/ipc/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,18 @@ impl<W: Write> FileWriter<W> {

Ok(())
}

/// Unwraps the BufWriter housed in FileWriter.writer, returning the underlying
/// writer
///
/// The buffer is flushed and the FileWriter is finished before returning the
/// writer.
pub fn into_inner(mut self) -> Result<W> {
if !self.finished {
self.finish()?;
}
self.writer.into_inner().map_err(ArrowError::from)
}
}

pub struct StreamWriter<W: Write> {
Expand Down

0 comments on commit ae0ad0e

Please sign in to comment.