File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -245,11 +245,10 @@ impl<S: Serializer> Visitor<S> {
245245 }
246246}
247247
248- /// Implements [`de::Visitor`] methods that simply forward scalar values to the appropriate
249- /// [`Serializer`] method.
250- macro_rules! xt_transcode_impl_scalar_visitors {
251- ( $( $name: ident( $( $arg: ident: $ty: ty) ?) => $op: expr; ) * ) => {
252- $( fn $name<E : :: serde:: de:: Error >( self , $( $arg: $ty) ?) -> :: std:: result:: Result <Self :: Value , E > {
248+ /// Implements the simplest [`de::Visitor`] methods that forward scalars to a [`Serializer`].
249+ macro_rules! impl_forward_scalar_visitors {
250+ ( $( $name: ident( $( $arg: ident: $ty: ty) ?) => $op: expr; ) * ) => {
251+ $( fn $name<E : de:: Error >( self , $( $arg: $ty) ?) -> Result <Self :: Value , E > {
253252 self . forward_scalar( $op)
254253 } ) *
255254 } ;
@@ -277,7 +276,7 @@ impl<'de, S: Serializer> de::Visitor<'de> for &mut Visitor<S> {
277276 f. write_str ( "any supported value" )
278277 }
279278
280- xt_transcode_impl_scalar_visitors ! {
279+ impl_forward_scalar_visitors ! {
281280 visit_unit( ) => |ser| ser. serialize_unit( ) ;
282281
283282 visit_bool( v: bool ) => |ser| ser. serialize_bool( v) ;
Original file line number Diff line number Diff line change @@ -72,9 +72,9 @@ impl Serialize for Value<'_> {
7272 }
7373}
7474
75- /// Implements [`de::Visitor`] methods that simply shove values into [`Value`]s.
76- macro_rules! xt_transcode_impl_value_visitors {
77- ( $ ( $name: ident( $( $arg: ident: $ty: ty) ?) => $result: expr; ) * ) => {
75+ /// Implements the simplest [`de::Visitor`] methods that shove scalars into [`Value`]s.
76+ macro_rules! impl_value_scalar_visitors {
77+ ( $ ( $name: ident( $( $arg: ident: $ty: ty) ?) => $result: expr; ) * ) => {
7878 $( fn $name<E : de:: Error >( self , $( $arg: $ty) ?) -> Result <Self :: Value , E > {
7979 Ok ( $result)
8080 } ) *
@@ -95,7 +95,7 @@ impl<'de: 'a, 'a> Deserialize<'de> for Value<'a> {
9595 f. write_str ( "any supported value" )
9696 }
9797
98- xt_transcode_impl_value_visitors ! {
98+ impl_value_scalar_visitors ! {
9999 visit_unit( ) => Value :: Unit ;
100100
101101 visit_bool( v: bool ) => Value :: Bool ( v) ;
You can’t perform that action at this time.
0 commit comments