Clippy: Fix the error of variants having the same prefix. (#31953)

* fix error: all variants have same prefix

* made the suggested changes

* fixed errors caused by commit

* silenced the clippy warning.

* ran ./mach fmt

* Update components/script/dom/htmlmediaelement.rs

Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com>

---------

Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
Aarya Khandelwal 2024-04-05 22:01:41 +05:30 committed by GitHub
parent 9ee45425e9
commit 275fad8b78
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 41 additions and 45 deletions

View file

@ -826,21 +826,19 @@ impl HTMLFormElement {
// Step 22
match (&*scheme, method) {
(_, FormMethod::FormDialog) => {
(_, FormMethod::Dialog) => {
// TODO: Submit dialog
// https://html.spec.whatwg.org/multipage/#submit-dialog
},
// https://html.spec.whatwg.org/multipage/#submit-mutate-action
("http", FormMethod::FormGet) |
("https", FormMethod::FormGet) |
("data", FormMethod::FormGet) => {
("http", FormMethod::Get) | ("https", FormMethod::Get) | ("data", FormMethod::Get) => {
load_data
.headers
.typed_insert(ContentType::from(mime::APPLICATION_WWW_FORM_URLENCODED));
self.mutate_action_url(&mut form_data, load_data, encoding, target_window);
},
// https://html.spec.whatwg.org/multipage/#submit-body
("http", FormMethod::FormPost) | ("https", FormMethod::FormPost) => {
("http", FormMethod::Post) | ("https", FormMethod::Post) => {
load_data.method = Method::POST;
self.submit_entity_body(
&mut form_data,
@ -853,16 +851,16 @@ impl HTMLFormElement {
// https://html.spec.whatwg.org/multipage/#submit-get-action
("file", _) |
("about", _) |
("data", FormMethod::FormPost) |
("data", FormMethod::Post) |
("ftp", _) |
("javascript", _) => {
self.plan_to_navigate(load_data, target_window);
},
("mailto", FormMethod::FormPost) => {
("mailto", FormMethod::Post) => {
// TODO: Mail as body
// https://html.spec.whatwg.org/multipage/#submit-mailto-body
},
("mailto", FormMethod::FormGet) => {
("mailto", FormMethod::Get) => {
// TODO: Mail with headers
// https://html.spec.whatwg.org/multipage/#submit-mailto-headers
},
@ -1361,9 +1359,9 @@ pub enum FormEncType {
#[derive(Clone, Copy, MallocSizeOf)]
pub enum FormMethod {
FormGet,
FormPost,
FormDialog,
Get,
Post,
Dialog,
}
/// <https://html.spec.whatwg.org/multipage/#form-associated-element>
@ -1431,9 +1429,9 @@ impl<'a> FormSubmitter<'a> {
),
};
match &*attr {
"dialog" => FormMethod::FormDialog,
"post" => FormMethod::FormPost,
_ => FormMethod::FormGet,
"dialog" => FormMethod::Dialog,
"post" => FormMethod::Post,
_ => FormMethod::Get,
}
}