From d0e5327c1741eb1dd4e1ea4c0c93716be9a71faf Mon Sep 17 00:00:00 2001 From: Ahmed Charles Date: Mon, 19 Feb 2024 05:15:45 -0800 Subject: [PATCH] feat: implement `into_inner` for `Encoder` Fixes: #64 Signed-off-by: Ahmed Charles --- ciborium-ll/src/enc.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ciborium-ll/src/enc.rs b/ciborium-ll/src/enc.rs index b8b8a20..44f2224 100644 --- a/ciborium-ll/src/enc.rs +++ b/ciborium-ll/src/enc.rs @@ -28,6 +28,11 @@ impl Write for Encoder { } impl Encoder { + /// Unwraps the `Write`, consuming the `Encoder`. + pub fn into_inner(self) -> W { + self.0 + } + /// Push a `Header` to the wire #[inline] pub fn push(&mut self, header: Header) -> Result<(), W::Error> {