diff options
author | eri <eri@inventati.org> | 2024-03-08 00:42:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-07 23:42:39 +0000 |
commit | 6c7fe31db13e31be339a6657931171db589307c7 (patch) | |
tree | c14e34cd852b52a53c9f723c1a2a34b4a48cf4f6 /ports/servoshell/parser.rs | |
parent | 3b19189896dfa82ce90ac37654bbb585d7ff7efa (diff) | |
download | servo-6c7fe31db13e31be339a6657931171db589307c7.tar.gz servo-6c7fe31db13e31be339a6657931171db589307c7.zip |
clippy: fix warnings on modules outside components (#31567)
Diffstat (limited to 'ports/servoshell/parser.rs')
-rw-r--r-- | ports/servoshell/parser.rs | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/ports/servoshell/parser.rs b/ports/servoshell/parser.rs index 860fe5a9484..e1a6334a5b9 100644 --- a/ports/servoshell/parser.rs +++ b/ports/servoshell/parser.rs @@ -28,17 +28,14 @@ pub fn get_default_url( // If the url is not provided, we fallback to the homepage in prefs, // or a blank page in case the homepage is not set either. let mut new_url = None; - let cmdline_url = url_opt - .clone() - .map(|s| s.to_string()) - .and_then(|url_string| { - parse_url_or_filename(cwd.as_ref(), &url_string) - .map_err(|error| { - warn!("URL parsing failed ({:?}).", error); - error - }) - .ok() - }); + let cmdline_url = url_opt.map(|s| s.to_string()).and_then(|url_string| { + parse_url_or_filename(cwd.as_ref(), &url_string) + .map_err(|error| { + warn!("URL parsing failed ({:?}).", error); + error + }) + .ok() + }); if let Some(url) = cmdline_url.clone() { // Check if the URL path corresponds to a file @@ -50,7 +47,7 @@ pub fn get_default_url( } } - if new_url.is_none() && !url_opt.is_none() { + if new_url.is_none() && url_opt.is_some() { new_url = location_bar_input_to_url(url_opt.unwrap()); } |