Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Commit

Permalink
Merge pull request #251 from jturner314-nrl/add-flush-method
Browse files Browse the repository at this point in the history
Add .flush() method to Serializer
  • Loading branch information
dtolnay committed Jul 16, 2022
2 parents f41880c + b8a018f commit db13750
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ser.rs
Expand Up @@ -48,6 +48,11 @@ where
}
}

/// Calls [`.flush()`](io::Write::flush) on the underlying `io::Write` object.
pub fn flush(&mut self) -> io::Result<()> {
self.writer.flush()
}

/// Unwrap the underlying `io::Write` object from the `Serializer`.
pub fn into_inner(self) -> W {
self.writer
Expand Down

0 comments on commit db13750

Please sign in to comment.