Have visit_enum_simple default to calling visit_tuple_variant

This commit is contained in:
Erick Tryzelaar 2015-07-29 14:06:17 -07:00
parent 0348a3914d
commit 97f08086dd
2 changed files with 8 additions and 10 deletions

View File

@ -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>;

View File

@ -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)
}