Skip to content

Commit 2127bdf

Browse files
committed
Update test
1 parent d6bb2e1 commit 2127bdf

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

Diff for: src/test/configuration_snippet.rs

+13-3
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,19 @@ impl ConfigCodeBlock {
190190
}
191191

192192
let report = report.unwrap();
193-
let result = report.format_result().next().unwrap();
194-
let text = result.1.formatted_text();
195-
!self.formatted_has_diff(text)
193+
let result = report.format_result().next();
194+
195+
match result {
196+
Some(result) => {
197+
let text = result.1.formatted_text();
198+
!self.formatted_has_diff(text)
199+
}
200+
None => {
201+
// The format report may be empty if the code block contains `#![rustfmt::skip]`.
202+
// In that case, we just return true.
203+
true
204+
}
205+
}
196206
}
197207

198208
// Extract a code block from the iterator. Behavior:

0 commit comments

Comments
 (0)