clippy: Fix a variety of warnings in components/script/dom (#31894)

This commit is contained in:
Ekta Siwach 2024-03-29 20:13:10 +05:30 committed by GitHub
parent 4a68243f65
commit b0196ad373
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 45 additions and 43 deletions

View file

@ -898,15 +898,15 @@ impl HTMLScriptElement {
warn!("Error creating input and output files for unminify");
}
let path;
match window_from_node(self).unminified_js_dir() {
Some(unminified_js_dir) => path = PathBuf::from(unminified_js_dir),
let path = match window_from_node(self).unminified_js_dir() {
Some(unminified_js_dir) => PathBuf::from(unminified_js_dir),
None => {
warn!("Unminified script directory not found");
return;
},
}
let (base, has_name) = match script.url.as_str().ends_with("/") {
};
let (base, has_name) = match script.url.as_str().ends_with('/') {
true => (
path.join(&script.url[url::Position::BeforeHost..])
.as_path()