Clippy: Fixed clippy warnings in components/script/dom (#31801)

* fixed clippy warnings in htmlformelement.rs

* Fixed clippy warnings

* Fixed warnings related to matches!

* made changes to compile "test-tidy" successfully
This commit is contained in:
Aarya Khandelwal 2024-03-21 12:44:12 +05:30 committed by GitHub
parent 5c0199b568
commit da3288dd00
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 108 additions and 111 deletions

View file

@ -859,7 +859,7 @@ impl HTMLFormElement {
load_data,
enctype,
encoding,
&target_window,
target_window,
);
},
// https://html.spec.whatwg.org/multipage/#submit-get-action
@ -868,7 +868,7 @@ impl HTMLFormElement {
("data", FormMethod::FormPost) |
("ftp", _) |
("javascript", _) => {
self.plan_to_navigate(load_data, &target_window);
self.plan_to_navigate(load_data, target_window);
},
("mailto", FormMethod::FormPost) => {
// TODO: Mail as body
@ -885,7 +885,7 @@ impl HTMLFormElement {
// https://html.spec.whatwg.org/multipage/#submit-mutate-action
fn mutate_action_url(
&self,
form_data: &mut Vec<FormDatum>,
form_data: &mut [FormDatum],
mut load_data: LoadData,
encoding: &'static Encoding,
target: &Window,
@ -1510,7 +1510,7 @@ pub trait FormControl: DomObject {
fn set_form_owner(&self, form: Option<&HTMLFormElement>);
fn to_element<'a>(&'a self) -> &'a Element;
fn to_element(&self) -> &Element;
fn is_listed(&self) -> bool {
true
@ -1721,11 +1721,11 @@ impl VirtualMethods for HTMLFormElement {
}
pub trait FormControlElementHelpers {
fn as_maybe_form_control<'a>(&'a self) -> Option<&'a dyn FormControl>;
fn as_maybe_form_control(&self) -> Option<&dyn FormControl>;
}
impl FormControlElementHelpers for Element {
fn as_maybe_form_control<'a>(&'a self) -> Option<&'a dyn FormControl> {
fn as_maybe_form_control(&self) -> Option<&dyn FormControl> {
let node = self.upcast::<Node>();
match node.type_id() {
@ -1766,7 +1766,7 @@ impl FormControlElementHelpers for Element {
// https://html.spec.whatwg.org/multipage/#multipart/form-data-encoding-algorithm
pub fn encode_multipart_form_data(
form_data: &mut Vec<FormDatum>,
form_data: &mut [FormDatum],
boundary: String,
encoding: &'static Encoding,
) -> Vec<u8> {