mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 13:25:17 +00:00
Introduce Token element (#7048)
This commit is contained in:
parent
2f3a950f6f
commit
c05e4628b1
78 changed files with 733 additions and 723 deletions
|
@ -30,7 +30,7 @@ impl FormatNodeRule<MatchCase> for FormatMatchCase {
|
|||
ClauseHeader::MatchCase(item),
|
||||
dangling_item_comments,
|
||||
&format_with(|f| {
|
||||
write!(f, [text("case"), space()])?;
|
||||
write!(f, [token("case"), space()])?;
|
||||
|
||||
let has_comments = comments.has_leading(pattern)
|
||||
|| comments.has_trailing_own_line(pattern);
|
||||
|
@ -58,7 +58,7 @@ impl FormatNodeRule<MatchCase> for FormatMatchCase {
|
|||
}
|
||||
|
||||
if let Some(guard) = guard {
|
||||
write!(f, [space(), text("if"), space(), guard.format()])?;
|
||||
write!(f, [space(), token("if"), space(), guard.format()])?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue