Skip to content

Commit

Permalink
Merge pull request #190 from Spartan2909/main
Browse files Browse the repository at this point in the history
Make `IOReader` and `EIOReader` constructors public
  • Loading branch information
jamesmunns authored Nov 27, 2024
2 parents 039bb1e + f736abe commit bfb6b73
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions source/postcard/src/de/flavors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,10 @@ pub mod io {
where
T: crate::eio::Read,
{
pub(crate) fn new(reader: T, buff: &'de mut [u8]) -> Self {
/// Create a new [`EIOReader`] from a reader and a buffer.
///
/// `buff` must have enough space to hold all data read during the deserialisation.
pub fn new(reader: T, buff: &'de mut [u8]) -> Self {
Self {
reader,
buff: SlidingBuffer::new(buff),
Expand Down Expand Up @@ -328,7 +331,10 @@ pub mod io {
where
T: std::io::Read,
{
pub(crate) fn new(reader: T, buff: &'de mut [u8]) -> Self {
/// Create a new [`IOReader`] from a reader and a buffer.
///
/// `buff` must have enough space to hold all data read during the deserialisation.
pub fn new(reader: T, buff: &'de mut [u8]) -> Self {
Self {
reader,
buff: SlidingBuffer::new(buff),
Expand Down

0 comments on commit bfb6b73

Please sign in to comment.