Skip to content

Commit 9fd34e0

Browse files
committed
Use #[rustfmt::skip]
1 parent e926148 commit 9fd34e0

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

tests/ui/single_match.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,8 @@ fn issue_10808(bar: Option<i32>) {
255255
}
256256

257257
match bar {
258+
#[rustfmt::skip]
258259
Some(v) => {
259-
// this comment prevents rustfmt from collapsing the block
260260
unsafe {
261261
let r = &v as *const i32;
262262
println!("{}", *r);

tests/ui/single_match.stderr

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ error: you seem to be trying to use `match` for destructuring a single pattern.
179179
--> $DIR/single_match.rs:257:5
180180
|
181181
LL | / match bar {
182+
LL | | #[rustfmt::skip]
182183
LL | | Some(v) => {
183-
LL | | // this comment prevents rustfmt from collapsing the block
184184
LL | | unsafe {
185185
... |
186186
LL | | _ => {},
@@ -190,7 +190,6 @@ LL | | }
190190
help: try this
191191
|
192192
LL ~ if let Some(v) = bar {
193-
LL + // this comment prevents rustfmt from collapsing the block
194193
LL + unsafe {
195194
LL + let r = &v as *const i32;
196195
LL + println!("{}", *r);

tests/ui/single_match_else.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ fn issue_10808(bar: Option<i32>) {
153153
}
154154

155155
match bar {
156+
#[rustfmt::skip]
156157
Some(v) => {
157-
// this comment prevents rustfmt from collapsing the block
158158
unsafe {
159159
let r = &v as *const i32;
160160
println!("{}", *r);
@@ -171,8 +171,8 @@ fn issue_10808(bar: Option<i32>) {
171171
println!("Some");
172172
println!("{v}");
173173
},
174+
#[rustfmt::skip]
174175
None => {
175-
// this comment prevents rustfmt from collapsing the block
176176
unsafe {
177177
let v = 0;
178178
let r = &v as *const i32;
@@ -182,15 +182,15 @@ fn issue_10808(bar: Option<i32>) {
182182
}
183183

184184
match bar {
185+
#[rustfmt::skip]
185186
Some(v) => {
186-
// this comment prevents rustfmt from collapsing the block
187187
unsafe {
188188
let r = &v as *const i32;
189189
println!("{}", *r);
190190
}
191191
},
192+
#[rustfmt::skip]
192193
None => {
193-
// this comment prevents rustfmt from collapsing the block
194194
unsafe {
195195
let v = 0;
196196
let r = &v as *const i32;

tests/ui/single_match_else.stderr

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ error: you seem to be trying to use `match` for destructuring a single pattern.
175175
--> $DIR/single_match_else.rs:155:5
176176
|
177177
LL | / match bar {
178+
LL | | #[rustfmt::skip]
178179
LL | | Some(v) => {
179-
LL | | // this comment prevents rustfmt from collapsing the block
180180
LL | | unsafe {
181181
... |
182182
LL | | },
@@ -186,7 +186,6 @@ LL | | }
186186
help: try this
187187
|
188188
LL ~ if let Some(v) = bar {
189-
LL + // this comment prevents rustfmt from collapsing the block
190189
LL + unsafe {
191190
LL + let r = &v as *const i32;
192191
LL + println!("{}", *r);

0 commit comments

Comments
 (0)