diff --git a/arrow-csv/src/writer.rs b/arrow-csv/src/writer.rs index d9331053f3d8..4ec0e1bec517 100644 --- a/arrow-csv/src/writer.rs +++ b/arrow-csv/src/writer.rs @@ -185,6 +185,12 @@ impl Writer { Ok(()) } + + /// Unwraps this `Writer`, returning the underlying writer. + pub fn into_inner(self) -> W { + // Safe to call `unwrap` since `write` always flushes the writer. + self.writer.into_inner().unwrap() + } } /// A CSV writer builder