From 20431706a863f92cb37dc512fef6e48d192aaf2c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:11:38 +0200 Subject: Merging upstream version 1.66.0+dfsg1. Signed-off-by: Daniel Baumann --- vendor/serde/src/ser/impls.rs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'vendor/serde/src/ser') diff --git a/vendor/serde/src/ser/impls.rs b/vendor/serde/src/ser/impls.rs index 7219f51b7..8e8655582 100644 --- a/vendor/serde/src/ser/impls.rs +++ b/vendor/serde/src/ser/impls.rs @@ -522,7 +522,7 @@ where } } -impl Serialize for RefCell +impl Serialize for RefCell where T: Serialize, { @@ -538,7 +538,7 @@ where } #[cfg(feature = "std")] -impl Serialize for Mutex +impl Serialize for Mutex where T: Serialize, { @@ -554,7 +554,7 @@ where } #[cfg(feature = "std")] -impl Serialize for RwLock +impl Serialize for RwLock where T: Serialize, { @@ -614,9 +614,10 @@ impl Serialize for SystemTime { S: Serializer, { use super::SerializeStruct; - let duration_since_epoch = self - .duration_since(UNIX_EPOCH) - .map_err(|_| S::Error::custom("SystemTime must be later than UNIX_EPOCH"))?; + let duration_since_epoch = match self.duration_since(UNIX_EPOCH) { + Ok(duration_since_epoch) => duration_since_epoch, + Err(_) => return Err(S::Error::custom("SystemTime must be later than UNIX_EPOCH")), + }; let mut state = try!(serializer.serialize_struct("SystemTime", 2)); try!(state.serialize_field("secs_since_epoch", &duration_since_epoch.as_secs())); try!(state.serialize_field("nanos_since_epoch", &duration_since_epoch.subsec_nanos())); @@ -916,7 +917,7 @@ macro_rules! atomic_impl { S: Serializer, { // Matches the atomic ordering used in libcore for the Debug impl - self.load(Ordering::SeqCst).serialize(serializer) + self.load(Ordering::Relaxed).serialize(serializer) } } )* -- cgit v1.2.3