forked from Proxmox/proxmox
schema: serialize enum unit variants
... since deserializing them already works Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
This commit is contained in:
parent
498341ec0d
commit
92be86d776
@ -483,14 +483,13 @@ impl<T: fmt::Write> Serializer for ElementSerializer<T> {
|
||||
}
|
||||
|
||||
fn serialize_unit_variant(
|
||||
self,
|
||||
name: &'static str,
|
||||
mut self,
|
||||
_name: &'static str,
|
||||
_index: u32,
|
||||
variant: &'static str,
|
||||
) -> Result<Self::Ok, Error> {
|
||||
Err(Error::msg(format!(
|
||||
"tried to serialize a unit variant ({name}::{variant})"
|
||||
)))
|
||||
self.inner.write_str(variant)?;
|
||||
Ok(self.inner)
|
||||
}
|
||||
|
||||
fn serialize_newtype_struct<V>(self, _name: &'static str, value: &V) -> Result<T, Error>
|
||||
|
Loading…
x
Reference in New Issue
Block a user