Skip to content

Commit 0cf3f6c

Browse files
author
Carter Green
authored
api: add Writer::get_ref
This matches an equivalent method on csv::Reader. We hold on on the 'get_mut' method as I have not fully thought it through. There might be footguns there. PR #322
1 parent d24eac1 commit 0cf3f6c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/writer.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,6 +1068,11 @@ impl<W: io::Write> Writer<W> {
10681068
Ok(())
10691069
}
10701070

1071+
/// Return a reference to the underlying writer.
1072+
pub fn get_ref(&self) -> &W {
1073+
self.wtr.as_ref().unwrap()
1074+
}
1075+
10711076
/// Flush the contents of the internal buffer and return the underlying
10721077
/// writer.
10731078
pub fn into_inner(

0 commit comments

Comments
 (0)