diff options
Diffstat (limited to 'vendor/icu_provider/src/serde')
-rw-r--r-- | vendor/icu_provider/src/serde/borrow_de_utils.rs | 2 | ||||
-rw-r--r-- | vendor/icu_provider/src/serde/mod.rs | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/vendor/icu_provider/src/serde/borrow_de_utils.rs b/vendor/icu_provider/src/serde/borrow_de_utils.rs index afce7641e..d614bc9ec 100644 --- a/vendor/icu_provider/src/serde/borrow_de_utils.rs +++ b/vendor/icu_provider/src/serde/borrow_de_utils.rs @@ -10,12 +10,14 @@ use serde::Deserialize; #[serde(transparent)] // Cows fail to borrow in some situations (array, option), but structs of Cows don't. #[allow(clippy::exhaustive_structs)] // newtype +#[derive(Debug)] pub struct CowWrap<'data>(#[serde(borrow)] pub Cow<'data, str>); #[derive(Deserialize)] #[serde(transparent)] // Cows fail to borrow in some situations (array, option), but structs of Cows don't. #[allow(clippy::exhaustive_structs)] // newtype +#[derive(Debug)] pub struct CowBytesWrap<'data>(#[serde(borrow)] pub Cow<'data, [u8]>); pub fn array_of_cow<'de, D, const N: usize>(deserializer: D) -> Result<[Cow<'de, str>; N], D::Error> diff --git a/vendor/icu_provider/src/serde/mod.rs b/vendor/icu_provider/src/serde/mod.rs index 2e96b3cb3..098f1e880 100644 --- a/vendor/icu_provider/src/serde/mod.rs +++ b/vendor/icu_provider/src/serde/mod.rs @@ -23,6 +23,7 @@ use yoke::trait_hack::YokeTraitHack; use yoke::Yokeable; /// A [`BufferProvider`] that deserializes its data using Serde. +#[derive(Debug)] pub struct DeserializingBufferProvider<'a, P: ?Sized>(&'a P); /// Blanket-implemented trait adding the [`Self::as_deserializing()`] function. @@ -101,7 +102,7 @@ impl DataPayload<BufferMarker> { /// use icu_provider::hello_world::*; /// use icu_provider::prelude::*; /// - /// let buffer: &[u8] = b"{\"message\":\"Hallo Welt\"}"; + /// let buffer: &[u8] = br#"{"message":"Hallo Welt"}"#; /// /// let buffer_payload = DataPayload::from_owned(buffer); /// let payload: DataPayload<HelloWorldV1Marker> = buffer_payload |