Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Result::expect instead of match and panic!
  • Loading branch information
yotamofek committed Jun 18, 2025
commit b2fe858a4e69e51e97d737496e938589b26db709
8 changes: 2 additions & 6 deletions src/librustdoc/html/render/write_shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,12 +439,8 @@ impl CratesIndexPart {
let content =
format!("<h1>List of all crates</h1><ul class=\"all-items\">{DELIMITER}</ul>");
let template = layout::render(layout, &page, "", content, style_files);
match SortedTemplate::from_template(&template, DELIMITER) {
Ok(template) => template,
Err(e) => panic!(
"Object Replacement Character (U+FFFC) should not appear in the --index-page: {e}"
),
}
SortedTemplate::from_template(&template, DELIMITER)
.expect("Object Replacement Character (U+FFFC) should not appear in the --index-page")
}

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