Skip to content

Commit

Permalink
Merge pull request #180 from dtolnay/fmt
Browse files Browse the repository at this point in the history
Format macro rules in consistent style
  • Loading branch information
dtolnay authored Apr 1, 2021
2 parents 4210276 + 8788e27 commit b4b1087
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/ident_fragment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ macro_rules! ident_fragment_display {
}
}
)*
}
};
}

ident_fragment_display!(bool, str, String, char);
Expand Down
2 changes: 1 addition & 1 deletion src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ pub mod ext {
}
}
)*
}
};
}

array_rep_slice!(
Expand Down
14 changes: 8 additions & 6 deletions src/to_tokens.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,15 @@ impl ToTokens for String {
}

macro_rules! primitive {
($($t:ident => $name:ident)*) => ($(
impl ToTokens for $t {
fn to_tokens(&self, tokens: &mut TokenStream) {
tokens.append(Literal::$name(*self));
($($t:ident => $name:ident)*) => {
$(
impl ToTokens for $t {
fn to_tokens(&self, tokens: &mut TokenStream) {
tokens.append(Literal::$name(*self));
}
}
}
)*)
)*
};
}

primitive! {
Expand Down

0 comments on commit b4b1087

Please sign in to comment.