Have visit_enum_simple default to calling visit_tuple_variant
This commit is contained in:
parent
0348a3914d
commit
97f08086dd
@ -131,7 +131,14 @@ pub trait Serializer {
|
||||
variant_index: usize,
|
||||
variant: &'static str,
|
||||
value: T) -> Result<(), Self::Error>
|
||||
where T: Serialize;
|
||||
where T: Serialize,
|
||||
{
|
||||
self.visit_tuple_variant(
|
||||
name,
|
||||
variant_index,
|
||||
variant,
|
||||
Some(value))
|
||||
}
|
||||
|
||||
fn visit_none(&mut self) -> Result<(), Self::Error>;
|
||||
|
||||
|
@ -39,15 +39,6 @@ impl serde::Serializer for BytesSerializer {
|
||||
Err(Error)
|
||||
}
|
||||
|
||||
fn visit_enum_simple<T>(&mut self,
|
||||
_name: &str,
|
||||
_variant_index: usize,
|
||||
_variant: &str,
|
||||
_value: T) -> Result<(), Error>
|
||||
{
|
||||
Err(Error)
|
||||
}
|
||||
|
||||
fn visit_bool(&mut self, _v: bool) -> Result<(), Error> {
|
||||
Err(Error)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user