Skip to content

Commit

Permalink
Make Encoder::put() public
Browse files Browse the repository at this point in the history
Signed-off-by: chrysn <[email protected]>
  • Loading branch information
chrysn committed Dec 5, 2024
1 parent e42c13d commit 0dd6693
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion minicbor/src/encode/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,11 @@ impl<W: Write> Encoder<W> {
}

/// Write the encoded byte slice.
pub(crate) fn put(&mut self, b: &[u8]) -> Result<&mut Self, Error<W::Error>> {
///
/// The byte slice may contain a single CBOR item, multiple items or even parts of an item; as
/// with maps and arrays, it is up to the caller to eventually provide the right number of
/// items.
pub fn put(&mut self, b: &[u8]) -> Result<&mut Self, Error<W::Error>> {
self.writer.write_all(b).map_err(Error::write)?;
Ok(self)
}
Expand Down

0 comments on commit 0dd6693

Please sign in to comment.