Skip to content

Commit

Permalink
api: add Writer::get_ref
Browse files Browse the repository at this point in the history
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
  • Loading branch information
threecgreen committed May 31, 2023
1 parent d24eac1 commit 0cf3f6c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1068,6 +1068,11 @@ impl<W: io::Write> Writer<W> {
Ok(())
}

/// Return a reference to the underlying writer.
pub fn get_ref(&self) -> &W {
self.wtr.as_ref().unwrap()
}

/// Flush the contents of the internal buffer and return the underlying
/// writer.
pub fn into_inner(
Expand Down

0 comments on commit 0cf3f6c

Please sign in to comment.