From 4f9fe856a25ab29345b90e7725509e9ee38a37be Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:41 +0200 Subject: Adding upstream version 1.69.0+dfsg1. Signed-off-by: Daniel Baumann --- vendor/icu_provider/src/serde/mod.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'vendor/icu_provider/src/serde/mod.rs') diff --git a/vendor/icu_provider/src/serde/mod.rs b/vendor/icu_provider/src/serde/mod.rs index d32148f02..2e96b3cb3 100644 --- a/vendor/icu_provider/src/serde/mod.rs +++ b/vendor/icu_provider/src/serde/mod.rs @@ -94,7 +94,7 @@ impl DataPayload { /// /// # Examples /// - /// Requires the `deserialize_json` feature: + /// Requires the `deserialize_json` Cargo feature: /// /// ``` /// use icu_provider::buf::BufferFormat; @@ -136,16 +136,16 @@ where { fn load_data(&self, key: DataKey, req: DataRequest) -> Result, DataError> { let buffer_response = BufferProvider::load_buffer(self.0, key, req)?; - let buffer_format = buffer_response - .metadata - .buffer_format - .ok_or_else(|| DataError::custom("BufferProvider didn't set BufferFormat"))?; + let buffer_format = buffer_response.metadata.buffer_format.ok_or_else(|| { + DataError::custom("BufferProvider didn't set BufferFormat").with_req(key, req) + })?; Ok(DataResponse { metadata: buffer_response.metadata, payload: buffer_response .payload .map(|p| p.into_deserialized(buffer_format)) - .transpose()?, + .transpose() + .map_err(|e| e.with_req(key, req))?, }) } } @@ -165,21 +165,21 @@ where } } -#[cfg(feature = "serde_json")] +#[cfg(feature = "deserialize_json")] impl From for crate::DataError { fn from(e: serde_json::error::Error) -> Self { crate::DataError::custom("JSON deserialize").with_display_context(&e) } } -#[cfg(feature = "bincode")] +#[cfg(feature = "deserialize_bincode_1")] impl From for crate::DataError { fn from(e: bincode::Error) -> Self { crate::DataError::custom("Bincode deserialize").with_display_context(&e) } } -#[cfg(feature = "postcard")] +#[cfg(feature = "deserialize_postcard_1")] impl From for crate::DataError { fn from(e: postcard::Error) -> Self { crate::DataError::custom("Postcard deserialize").with_display_context(&e) -- cgit v1.2.3