LibURL: Port create_with_file_scheme to Optional

Removing one of the main remaining users of URL valid state.
This commit is contained in:
Shannon Booth 2025-04-19 16:43:17 +12:00 committed by Tim Flynn
commit 00bbb2105b
Notes: github-actions[bot] 2025-04-19 11:20:14 +00:00
5 changed files with 18 additions and 16 deletions

View file

@ -119,8 +119,8 @@ Web::DragEvent ns_event_to_drag_event(Web::DragEvent::Type type, id<NSDraggingIn
Vector<URL::URL> urls;
for_each_file([&](ByteString const& file_path) {
if (auto url = URL::create_with_url_or_path(file_path); url.is_valid())
urls.append(move(url));
if (auto url = URL::create_with_url_or_path(file_path); url.has_value())
urls.append(url.release_value());
});
browser_data = make<DragData>(move(urls));