Skip to content

Commit b2fe858

Browse files
committed
Result::expect instead of match and panic!
1 parent 27733d4 commit b2fe858

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/librustdoc/html/render/write_shared.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -439,12 +439,8 @@ impl CratesIndexPart {
439439
let content =
440440
format!("<h1>List of all crates</h1><ul class=\"all-items\">{DELIMITER}</ul>");
441441
let template = layout::render(layout, &page, "", content, style_files);
442-
match SortedTemplate::from_template(&template, DELIMITER) {
443-
Ok(template) => template,
444-
Err(e) => panic!(
445-
"Object Replacement Character (U+FFFC) should not appear in the --index-page: {e}"
446-
),
447-
}
442+
SortedTemplate::from_template(&template, DELIMITER)
443+
.expect("Object Replacement Character (U+FFFC) should not appear in the --index-page")
448444
}
449445

450446
/// Might return parts that are duplicate with ones in prexisting index.html

0 commit comments

Comments
 (0)