Convert some token_joint_hidden calls to token_joint.

This has no noticeable effect, but it makes these cases follow the
guidelines in the comments on `Spacing`, which say that `Joint` should
be used "for each token that (a) should be pretty-printed without a
space after it, and (b) is followed by a punctuation token".

These two tokens are both followed by a comma, which is a punctuation
token.
This commit is contained in:
Nicholas Nethercote 2024-05-17 09:49:09 +10:00
parent b6de782198
commit c679a55102

View File

@ -153,7 +153,7 @@ fn build_unlikely(&self, cond_expr: P<Expr>) -> P<Expr> {
fn build_panic(&self, expr_str: &str, panic_path: Path) -> P<Expr> { fn build_panic(&self, expr_str: &str, panic_path: Path) -> P<Expr> {
let escaped_expr_str = escape_to_fmt(expr_str); let escaped_expr_str = escape_to_fmt(expr_str);
let initial = [ let initial = [
TokenTree::token_joint_hidden( TokenTree::token_joint(
token::Literal(token::Lit { token::Literal(token::Lit {
kind: token::LitKind::Str, kind: token::LitKind::Str,
symbol: Symbol::intern(&if self.fmt_string.is_empty() { symbol: Symbol::intern(&if self.fmt_string.is_empty() {
@ -172,7 +172,7 @@ fn build_panic(&self, expr_str: &str, panic_path: Path) -> P<Expr> {
]; ];
let captures = self.capture_decls.iter().flat_map(|cap| { let captures = self.capture_decls.iter().flat_map(|cap| {
[ [
TokenTree::token_joint_hidden( TokenTree::token_joint(
token::Ident(cap.ident.name, IdentIsRaw::No), token::Ident(cap.ident.name, IdentIsRaw::No),
cap.ident.span, cap.ident.span,
), ),