Pass variant index to visit_enum_simple
This commit is contained in:
parent
5dc245d2ce
commit
0348a3914d
@ -127,9 +127,10 @@ pub trait Serializer {
|
||||
|
||||
#[inline]
|
||||
fn visit_enum_simple<T>(&mut self,
|
||||
_name: &str,
|
||||
_variant: &str,
|
||||
_value: T) -> Result<(), Self::Error>
|
||||
name: &'static str,
|
||||
variant_index: usize,
|
||||
variant: &'static str,
|
||||
value: T) -> Result<(), Self::Error>
|
||||
where T: Serialize;
|
||||
|
||||
fn visit_none(&mut self) -> Result<(), Self::Error>;
|
||||
|
@ -309,6 +309,7 @@ fn serialize_variant(
|
||||
::serde::ser::Serializer::visit_enum_simple(
|
||||
serializer,
|
||||
$type_name,
|
||||
$variant_index,
|
||||
$variant_name,
|
||||
__simple_value,
|
||||
)
|
||||
|
@ -174,6 +174,7 @@ impl<W, F> ser::Serializer for Serializer<W, F>
|
||||
#[inline]
|
||||
fn visit_enum_simple<T>(&mut self,
|
||||
_name: &str,
|
||||
_variant_index: usize,
|
||||
variant: &str,
|
||||
value: T,
|
||||
) -> io::Result<()>
|
||||
|
@ -474,6 +474,7 @@ impl ser::Serializer for Serializer {
|
||||
#[inline]
|
||||
fn visit_enum_simple<T>(&mut self,
|
||||
_name: &str,
|
||||
_variant_index: usize,
|
||||
variant: &str,
|
||||
value: T,
|
||||
) -> Result<(), ()>
|
||||
|
@ -41,6 +41,7 @@ impl serde::Serializer for BytesSerializer {
|
||||
|
||||
fn visit_enum_simple<T>(&mut self,
|
||||
_name: &str,
|
||||
_variant_index: usize,
|
||||
_variant: &str,
|
||||
_value: T) -> Result<(), Error>
|
||||
{
|
||||
|
@ -84,6 +84,7 @@ impl<'a> Serializer for AssertSerializer<'a> {
|
||||
|
||||
fn visit_enum_simple<T>(&mut self,
|
||||
name: &str,
|
||||
_variant_index: usize,
|
||||
variant: &str,
|
||||
value: T,
|
||||
) -> Result<(), ()>
|
||||
|
Loading…
Reference in New Issue
Block a user