Adjust spacing in some macro matchers
This commit is contained in:
parent
5361c790bb
commit
86161ce15f
@ -733,7 +733,7 @@ impl<'de> Deserialize<'de> for CString {
|
|||||||
macro_rules! forwarded_impl {
|
macro_rules! forwarded_impl {
|
||||||
(
|
(
|
||||||
$(#[doc = $doc:tt])*
|
$(#[doc = $doc:tt])*
|
||||||
( $($id: ident),* ), $ty: ty, $func: expr
|
($($id:ident),*), $ty:ty, $func:expr
|
||||||
) => {
|
) => {
|
||||||
$(#[doc = $doc])*
|
$(#[doc = $doc])*
|
||||||
impl<'de $(, $id : Deserialize<'de>,)*> Deserialize<'de> for $ty {
|
impl<'de $(, $id : Deserialize<'de>,)*> Deserialize<'de> for $ty {
|
||||||
@ -860,7 +860,7 @@ impl<'de, T: ?Sized> Deserialize<'de> for PhantomData<T> {
|
|||||||
#[cfg(any(feature = "std", feature = "alloc"))]
|
#[cfg(any(feature = "std", feature = "alloc"))]
|
||||||
macro_rules! seq_impl {
|
macro_rules! seq_impl {
|
||||||
(
|
(
|
||||||
$ty:ident < T $(: $tbound1:ident $(+ $tbound2:ident)*)* $(, $typaram:ident : $bound1:ident $(+ $bound2:ident)*)* >,
|
$ty:ident <T $(: $tbound1:ident $(+ $tbound2:ident)*)* $(, $typaram:ident : $bound1:ident $(+ $bound2:ident)*)*>,
|
||||||
$access:ident,
|
$access:ident,
|
||||||
$clear:expr,
|
$clear:expr,
|
||||||
$with_capacity:expr,
|
$with_capacity:expr,
|
||||||
@ -1353,7 +1353,7 @@ tuple_impls! {
|
|||||||
#[cfg(any(feature = "std", feature = "alloc"))]
|
#[cfg(any(feature = "std", feature = "alloc"))]
|
||||||
macro_rules! map_impl {
|
macro_rules! map_impl {
|
||||||
(
|
(
|
||||||
$ty:ident < K $(: $kbound1:ident $(+ $kbound2:ident)*)*, V $(, $typaram:ident : $bound1:ident $(+ $bound2:ident)*)* >,
|
$ty:ident <K $(: $kbound1:ident $(+ $kbound2:ident)*)*, V $(, $typaram:ident : $bound1:ident $(+ $bound2:ident)*)*>,
|
||||||
$access:ident,
|
$access:ident,
|
||||||
$with_capacity:expr
|
$with_capacity:expr
|
||||||
) => {
|
) => {
|
||||||
@ -1440,15 +1440,15 @@ macro_rules! parse_ip_impl {
|
|||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
macro_rules! variant_identifier {
|
macro_rules! variant_identifier {
|
||||||
(
|
(
|
||||||
$name_kind: ident ( $($variant: ident; $bytes: expr; $index: expr),* )
|
$name_kind:ident ($($variant:ident; $bytes:expr; $index:expr),*)
|
||||||
$expecting_message: expr,
|
$expecting_message:expr,
|
||||||
$variants_name: ident
|
$variants_name:ident
|
||||||
) => {
|
) => {
|
||||||
enum $name_kind {
|
enum $name_kind {
|
||||||
$( $variant ),*
|
$($variant),*
|
||||||
}
|
}
|
||||||
|
|
||||||
static $variants_name: &'static [&'static str] = &[ $( stringify!($variant) ),*];
|
static $variants_name: &'static [&'static str] = &[$(stringify!($variant)),*];
|
||||||
|
|
||||||
impl<'de> Deserialize<'de> for $name_kind {
|
impl<'de> Deserialize<'de> for $name_kind {
|
||||||
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
|
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
|
||||||
@ -1515,12 +1515,12 @@ macro_rules! variant_identifier {
|
|||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
macro_rules! deserialize_enum {
|
macro_rules! deserialize_enum {
|
||||||
(
|
(
|
||||||
$name: ident $name_kind: ident ( $($variant: ident; $bytes: expr; $index: expr),* )
|
$name:ident $name_kind:ident ($($variant:ident; $bytes:expr; $index:expr),*)
|
||||||
$expecting_message: expr,
|
$expecting_message:expr,
|
||||||
$deserializer: expr
|
$deserializer:expr
|
||||||
) => {
|
) => {
|
||||||
variant_identifier!{
|
variant_identifier! {
|
||||||
$name_kind ( $($variant; $bytes; $index),* )
|
$name_kind ($($variant; $bytes; $index),*)
|
||||||
$expecting_message,
|
$expecting_message,
|
||||||
VARIANTS
|
VARIANTS
|
||||||
}
|
}
|
||||||
@ -2678,7 +2678,7 @@ macro_rules! atomic_impl {
|
|||||||
|
|
||||||
#[cfg(all(feature = "std", use_target_has_atomic))]
|
#[cfg(all(feature = "std", use_target_has_atomic))]
|
||||||
macro_rules! atomic_impl {
|
macro_rules! atomic_impl {
|
||||||
( $( $ty:ident $size:expr ),* ) => {
|
($($ty:ident $size:expr),*) => {
|
||||||
$(
|
$(
|
||||||
#[cfg(target_has_atomic = $size)]
|
#[cfg(target_has_atomic = $size)]
|
||||||
impl<'de> Deserialize<'de> for $ty {
|
impl<'de> Deserialize<'de> for $ty {
|
||||||
|
@ -2708,7 +2708,7 @@ where
|
|||||||
|
|
||||||
#[cfg(any(feature = "std", feature = "alloc"))]
|
#[cfg(any(feature = "std", feature = "alloc"))]
|
||||||
macro_rules! forward_to_deserialize_other {
|
macro_rules! forward_to_deserialize_other {
|
||||||
($($func:ident ( $($arg:ty),* ))*) => {
|
($($func:ident ($($arg:ty),*))*) => {
|
||||||
$(
|
$(
|
||||||
fn $func<V>(self, $(_: $arg,)* _visitor: V) -> Result<V::Value, Self::Error>
|
fn $func<V>(self, $(_: $arg,)* _visitor: V) -> Result<V::Value, Self::Error>
|
||||||
where
|
where
|
||||||
|
@ -184,7 +184,7 @@ where
|
|||||||
|
|
||||||
#[cfg(all(any(feature = "std", feature = "alloc"), not(no_relaxed_trait_bounds)))]
|
#[cfg(all(any(feature = "std", feature = "alloc"), not(no_relaxed_trait_bounds)))]
|
||||||
macro_rules! seq_impl {
|
macro_rules! seq_impl {
|
||||||
($ty:ident < T $(: $tbound1:ident $(+ $tbound2:ident)*)* $(, $typaram:ident : $bound:ident)* >) => {
|
($ty:ident <T $(: $tbound1:ident $(+ $tbound2:ident)*)* $(, $typaram:ident : $bound:ident)*>) => {
|
||||||
impl<T $(, $typaram)*> Serialize for $ty<T $(, $typaram)*>
|
impl<T $(, $typaram)*> Serialize for $ty<T $(, $typaram)*>
|
||||||
where
|
where
|
||||||
T: Serialize,
|
T: Serialize,
|
||||||
@ -202,7 +202,7 @@ macro_rules! seq_impl {
|
|||||||
|
|
||||||
#[cfg(all(any(feature = "std", feature = "alloc"), no_relaxed_trait_bounds))]
|
#[cfg(all(any(feature = "std", feature = "alloc"), no_relaxed_trait_bounds))]
|
||||||
macro_rules! seq_impl {
|
macro_rules! seq_impl {
|
||||||
($ty:ident < T $(: $tbound1:ident $(+ $tbound2:ident)*)* $(, $typaram:ident : $bound:ident)* >) => {
|
($ty:ident <T $(: $tbound1:ident $(+ $tbound2:ident)*)* $(, $typaram:ident : $bound:ident)*>) => {
|
||||||
impl<T $(, $typaram)*> Serialize for $ty<T $(, $typaram)*>
|
impl<T $(, $typaram)*> Serialize for $ty<T $(, $typaram)*>
|
||||||
where
|
where
|
||||||
T: Serialize $(+ $tbound1 $(+ $tbound2)*)*,
|
T: Serialize $(+ $tbound1 $(+ $tbound2)*)*,
|
||||||
@ -367,7 +367,7 @@ tuple_impls! {
|
|||||||
|
|
||||||
#[cfg(all(any(feature = "std", feature = "alloc"), not(no_relaxed_trait_bounds)))]
|
#[cfg(all(any(feature = "std", feature = "alloc"), not(no_relaxed_trait_bounds)))]
|
||||||
macro_rules! map_impl {
|
macro_rules! map_impl {
|
||||||
($ty:ident < K $(: $kbound1:ident $(+ $kbound2:ident)*)*, V $(, $typaram:ident : $bound:ident)* >) => {
|
($ty:ident <K $(: $kbound1:ident $(+ $kbound2:ident)*)*, V $(, $typaram:ident : $bound:ident)*>) => {
|
||||||
impl<K, V $(, $typaram)*> Serialize for $ty<K, V $(, $typaram)*>
|
impl<K, V $(, $typaram)*> Serialize for $ty<K, V $(, $typaram)*>
|
||||||
where
|
where
|
||||||
K: Serialize,
|
K: Serialize,
|
||||||
@ -386,7 +386,7 @@ macro_rules! map_impl {
|
|||||||
|
|
||||||
#[cfg(all(any(feature = "std", feature = "alloc"), no_relaxed_trait_bounds))]
|
#[cfg(all(any(feature = "std", feature = "alloc"), no_relaxed_trait_bounds))]
|
||||||
macro_rules! map_impl {
|
macro_rules! map_impl {
|
||||||
($ty:ident < K $(: $kbound1:ident $(+ $kbound2:ident)*)*, V $(, $typaram:ident : $bound:ident)* >) => {
|
($ty:ident <K $(: $kbound1:ident $(+ $kbound2:ident)*)*, V $(, $typaram:ident : $bound:ident)*>) => {
|
||||||
impl<K, V $(, $typaram)*> Serialize for $ty<K, V $(, $typaram)*>
|
impl<K, V $(, $typaram)*> Serialize for $ty<K, V $(, $typaram)*>
|
||||||
where
|
where
|
||||||
K: Serialize $(+ $kbound1 $(+ $kbound2)*)*,
|
K: Serialize $(+ $kbound1 $(+ $kbound2)*)*,
|
||||||
@ -502,7 +502,7 @@ where
|
|||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
macro_rules! nonzero_integers {
|
macro_rules! nonzero_integers {
|
||||||
( $( $T: ident, )+ ) => {
|
($($T:ident,)+) => {
|
||||||
$(
|
$(
|
||||||
#[cfg(not(no_num_nonzero))]
|
#[cfg(not(no_num_nonzero))]
|
||||||
impl Serialize for num::$T {
|
impl Serialize for num::$T {
|
||||||
@ -964,7 +964,7 @@ macro_rules! atomic_impl {
|
|||||||
|
|
||||||
#[cfg(all(feature = "std", use_target_has_atomic))]
|
#[cfg(all(feature = "std", use_target_has_atomic))]
|
||||||
macro_rules! atomic_impl {
|
macro_rules! atomic_impl {
|
||||||
( $( $ty:ident $size:expr ),* ) => {
|
($($ty:ident $size:expr),*) => {
|
||||||
$(
|
$(
|
||||||
#[cfg(target_has_atomic = $size)]
|
#[cfg(target_has_atomic = $size)]
|
||||||
impl Serialize for $ty {
|
impl Serialize for $ty {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user