clippy: fix warnings on modules outside components (#31567)

This commit is contained in:
eri 2024-03-08 00:42:39 +01:00 committed by GitHub
parent 3b19189896
commit 6c7fe31db1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 37 additions and 46 deletions

View file

@ -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());
}