We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d6bb2e1 commit 2127bdfCopy full SHA for 2127bdf
src/test/configuration_snippet.rs
@@ -190,9 +190,19 @@ impl ConfigCodeBlock {
190
}
191
192
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)
+ let result = report.format_result().next();
+
+ 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
206
207
208
// Extract a code block from the iterator. Behavior:
0 commit comments