From 47cc004e06c0d9329b488497b3b52561c362d2f7 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Sun, 23 Jan 2022 12:01:45 +0100 Subject: [PATCH] serde: Add Base64::into_inner --- crates/ruma-serde/src/base64.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/ruma-serde/src/base64.rs b/crates/ruma-serde/src/base64.rs index a2ac16bf..1ab0b1ab 100644 --- a/crates/ruma-serde/src/base64.rs +++ b/crates/ruma-serde/src/base64.rs @@ -18,7 +18,7 @@ impl> Base64 { Self { bytes } } - /// Get the raw bytes held by this `Base64` instance. + /// Get a reference to the raw bytes held by this `Base64` instance. pub fn as_bytes(&self) -> &[u8] { self.bytes.as_ref() } @@ -29,6 +29,13 @@ impl> Base64 { } } +impl Base64 { + /// Get the raw bytes held by this `Base64` instance. + pub fn into_inner(self) -> B { + self.bytes + } +} + impl Base64 { /// Create a `Base64` instance containing an empty `Vec`. pub fn empty() -> Self {