summaryrefslogtreecommitdiffstats
path: root/vendor/toml_edit/src/ser/value.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:57:31 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:57:31 +0000
commitdc0db358abe19481e475e10c32149b53370f1a1c (patch)
treeab8ce99c4b255ce46f99ef402c27916055b899ee /vendor/toml_edit/src/ser/value.rs
parentReleasing progress-linux version 1.71.1+dfsg1-2~progress7.99u1. (diff)
downloadrustc-dc0db358abe19481e475e10c32149b53370f1a1c.tar.xz
rustc-dc0db358abe19481e475e10c32149b53370f1a1c.zip
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/toml_edit/src/ser/value.rs')
-rw-r--r--vendor/toml_edit/src/ser/value.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/vendor/toml_edit/src/ser/value.rs b/vendor/toml_edit/src/ser/value.rs
index cc7dfb773..d29390a4c 100644
--- a/vendor/toml_edit/src/ser/value.rs
+++ b/vendor/toml_edit/src/ser/value.rs
@@ -167,15 +167,18 @@ impl serde::ser::Serializer for ValueSerializer {
fn serialize_newtype_variant<T: ?Sized>(
self,
- name: &'static str,
+ _name: &'static str,
_variant_index: u32,
- _variant: &'static str,
- _value: &T,
+ variant: &'static str,
+ value: &T,
) -> Result<Self::Ok, Self::Error>
where
T: serde::ser::Serialize,
{
- Err(Error::UnsupportedType(Some(name)))
+ let value = value.serialize(self)?;
+ let mut table = crate::InlineTable::new();
+ table.insert(variant, value);
+ Ok(table.into())
}
fn serialize_seq(self, len: Option<usize>) -> Result<Self::SerializeSeq, Self::Error> {