Skip to content

Commit

Permalink
Adjust spacing in some macro matchers
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Dec 11, 2022
1 parent 5361c79 commit 86161ce
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
28 changes: 14 additions & 14 deletions serde/src/de/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ impl<'de> Deserialize<'de> for CString {
macro_rules! forwarded_impl {
(
$(#[doc = $doc:tt])*
( $($id: ident),* ), $ty: ty, $func: expr
($($id:ident),*), $ty:ty, $func:expr
) => {
$(#[doc = $doc])*
impl<'de $(, $id : Deserialize<'de>,)*> Deserialize<'de> for $ty {
Expand Down Expand Up @@ -860,7 +860,7 @@ impl<'de, T: ?Sized> Deserialize<'de> for PhantomData<T> {
#[cfg(any(feature = "std", feature = "alloc"))]
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,
$clear:expr,
$with_capacity:expr,
Expand Down Expand Up @@ -1353,7 +1353,7 @@ tuple_impls! {
#[cfg(any(feature = "std", feature = "alloc"))]
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,
$with_capacity:expr
) => {
Expand Down Expand Up @@ -1440,15 +1440,15 @@ macro_rules! parse_ip_impl {
#[cfg(feature = "std")]
macro_rules! variant_identifier {
(
$name_kind: ident ( $($variant: ident; $bytes: expr; $index: expr),* )
$expecting_message: expr,
$variants_name: ident
$name_kind:ident ($($variant:ident; $bytes:expr; $index:expr),*)
$expecting_message:expr,
$variants_name:ident
) => {
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 {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
Expand Down Expand Up @@ -1515,12 +1515,12 @@ macro_rules! variant_identifier {
#[cfg(feature = "std")]
macro_rules! deserialize_enum {
(
$name: ident $name_kind: ident ( $($variant: ident; $bytes: expr; $index: expr),* )
$expecting_message: expr,
$deserializer: expr
$name:ident $name_kind:ident ($($variant:ident; $bytes:expr; $index:expr),*)
$expecting_message:expr,
$deserializer:expr
) => {
variant_identifier!{
$name_kind ( $($variant; $bytes; $index),* )
variant_identifier! {
$name_kind ($($variant; $bytes; $index),*)
$expecting_message,
VARIANTS
}
Expand Down Expand Up @@ -2678,7 +2678,7 @@ macro_rules! atomic_impl {

#[cfg(all(feature = "std", use_target_has_atomic))]
macro_rules! atomic_impl {
( $( $ty:ident $size:expr ),* ) => {
($($ty:ident $size:expr),*) => {
$(
#[cfg(target_has_atomic = $size)]
impl<'de> Deserialize<'de> for $ty {
Expand Down
2 changes: 1 addition & 1 deletion serde/src/private/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2708,7 +2708,7 @@ where

#[cfg(any(feature = "std", feature = "alloc"))]
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>
where
Expand Down
12 changes: 6 additions & 6 deletions serde/src/ser/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ where

#[cfg(all(any(feature = "std", feature = "alloc"), not(no_relaxed_trait_bounds)))]
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)*>
where
T: Serialize,
Expand All @@ -202,7 +202,7 @@ macro_rules! seq_impl {

#[cfg(all(any(feature = "std", feature = "alloc"), no_relaxed_trait_bounds))]
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)*>
where
T: Serialize $(+ $tbound1 $(+ $tbound2)*)*,
Expand Down Expand Up @@ -367,7 +367,7 @@ tuple_impls! {

#[cfg(all(any(feature = "std", feature = "alloc"), not(no_relaxed_trait_bounds)))]
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)*>
where
K: Serialize,
Expand All @@ -386,7 +386,7 @@ macro_rules! map_impl {

#[cfg(all(any(feature = "std", feature = "alloc"), no_relaxed_trait_bounds))]
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)*>
where
K: Serialize $(+ $kbound1 $(+ $kbound2)*)*,
Expand Down Expand Up @@ -502,7 +502,7 @@ where
////////////////////////////////////////////////////////////////////////////////

macro_rules! nonzero_integers {
( $( $T: ident, )+ ) => {
($($T:ident,)+) => {
$(
#[cfg(not(no_num_nonzero))]
impl Serialize for num::$T {
Expand Down Expand Up @@ -964,7 +964,7 @@ macro_rules! atomic_impl {

#[cfg(all(feature = "std", use_target_has_atomic))]
macro_rules! atomic_impl {
( $( $ty:ident $size:expr ),* ) => {
($($ty:ident $size:expr),*) => {
$(
#[cfg(target_has_atomic = $size)]
impl Serialize for $ty {
Expand Down

0 comments on commit 86161ce

Please sign in to comment.