LibWeb: Make MimeSniff::MimeType::parse() infallible

It already returns an empty Optional for failures, so there's no need to
wrap it in an ErrorOr as well.
This commit is contained in:
Andreas Kling 2024-10-14 11:18:44 +02:00 committed by Andreas Kling
parent 88e7688940
commit 5c20bc2afc
Notes: github-actions[bot] 2024-10-14 18:48:45 +00:00
15 changed files with 39 additions and 37 deletions

View file

@ -97,7 +97,7 @@ ErrorOr<DataURL> process_data_url(URL::URL const& data_url)
}
// 13. Let mimeTypeRecord be the result of parsing mimeType.
auto mime_type_record = TRY(MimeSniff::MimeType::parse(mime_type));
auto mime_type_record = MimeSniff::MimeType::parse(mime_type);
// 14. If mimeTypeRecord is failure, then set mimeTypeRecord to text/plain;charset=US-ASCII.
if (!mime_type_record.has_value()) {