summaryrefslogtreecommitdiffstats
path: root/vendor/serde/src/private/ser.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:11:38 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:13:23 +0000
commit20431706a863f92cb37dc512fef6e48d192aaf2c (patch)
tree2867f13f5fd5437ba628c67d7f87309ccadcd286 /vendor/serde/src/private/ser.rs
parentReleasing progress-linux version 1.65.0+dfsg1-2~progress7.99u1. (diff)
downloadrustc-20431706a863f92cb37dc512fef6e48d192aaf2c.tar.xz
rustc-20431706a863f92cb37dc512fef6e48d192aaf2c.zip
Merging upstream version 1.66.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--vendor/serde/src/private/ser.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/vendor/serde/src/private/ser.rs b/vendor/serde/src/private/ser.rs
index 6ee999389..293d8a865 100644
--- a/vendor/serde/src/private/ser.rs
+++ b/vendor/serde/src/private/ser.rs
@@ -51,7 +51,6 @@ enum Unsupported {
String,
ByteArray,
Optional,
- Unit,
#[cfg(any(feature = "std", feature = "alloc"))]
UnitStruct,
Sequence,
@@ -70,7 +69,6 @@ impl Display for Unsupported {
Unsupported::String => formatter.write_str("a string"),
Unsupported::ByteArray => formatter.write_str("a byte array"),
Unsupported::Optional => formatter.write_str("an optional"),
- Unsupported::Unit => formatter.write_str("unit"),
#[cfg(any(feature = "std", feature = "alloc"))]
Unsupported::UnitStruct => formatter.write_str("unit struct"),
Unsupported::Sequence => formatter.write_str("a sequence"),
@@ -184,7 +182,9 @@ where
}
fn serialize_unit(self) -> Result<Self::Ok, Self::Error> {
- Err(self.bad_type(Unsupported::Unit))
+ let mut map = try!(self.delegate.serialize_map(Some(1)));
+ try!(map.serialize_entry(self.tag, self.variant_name));
+ map.end()
}
fn serialize_unit_struct(self, _: &'static str) -> Result<Self::Ok, Self::Error> {