mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Add commas after skipped arms when needed
This commit is contained in:
parent
bd32589ff5
commit
16b348dd9c
@ -898,8 +898,7 @@ impl Rewrite for ast::Arm {
|
||||
attr_visitor.last_pos = attrs[0].span.lo;
|
||||
if attr_visitor.visit_attrs(attrs) {
|
||||
// Attributes included a skip instruction.
|
||||
let snippet = context.snippet(mk_sp(attrs[0].span.lo, body.span.hi));
|
||||
return Some(snippet);
|
||||
return None;
|
||||
}
|
||||
attr_visitor.format_missing(pats[0].span.lo);
|
||||
attr_visitor.buffer.to_string()
|
||||
|
@ -100,6 +100,14 @@ fn matches() {
|
||||
}
|
||||
}
|
||||
|
||||
fn match_skip() {
|
||||
let _ = match Some(1) {
|
||||
#[rustfmt_skip]
|
||||
Some( n ) => n,
|
||||
None => 1,
|
||||
};
|
||||
}
|
||||
|
||||
fn issue339() {
|
||||
match a {
|
||||
b => {}
|
||||
|
@ -115,6 +115,14 @@ fn matches() {
|
||||
}
|
||||
}
|
||||
|
||||
fn match_skip() {
|
||||
let _ = match Some(1) {
|
||||
#[rustfmt_skip]
|
||||
Some( n ) => n,
|
||||
None => 1,
|
||||
};
|
||||
}
|
||||
|
||||
fn issue339() {
|
||||
match a {
|
||||
b => {}
|
||||
|
Loading…
Reference in New Issue
Block a user