clippy: Fix a bunch of warnings in script (#32680)

This is just a portion of the errors that are remaining to be fixed.
This commit is contained in:
Martin Robinson 2024-07-04 13:40:23 +02:00 committed by GitHub
parent 93fdb8263d
commit 26624a109f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 150 additions and 113 deletions

View file

@ -917,14 +917,14 @@ impl HTMLFormElement {
url.query().unwrap_or("").to_string().into_bytes()
},
FormEncType::FormDataEncoded => {
FormEncType::MultipartFormData => {
let mime: Mime = format!("multipart/form-data; boundary={}", boundary)
.parse()
.unwrap();
load_data.headers.typed_insert(ContentType::from(mime));
encode_multipart_form_data(form_data, boundary, encoding)
},
FormEncType::TextPlainEncoded => {
FormEncType::TextPlain => {
load_data
.headers
.typed_insert(ContentType::from(mime::TEXT_PLAIN));
@ -1366,9 +1366,9 @@ impl FormDatum {
#[derive(Clone, Copy, MallocSizeOf)]
pub enum FormEncType {
TextPlainEncoded,
TextPlain,
UrlEncoded,
FormDataEncoded,
MultipartFormData,
}
#[derive(Clone, Copy, MallocSizeOf)]
@ -1420,8 +1420,8 @@ impl<'a> FormSubmitter<'a> {
),
};
match &*attr {
"multipart/form-data" => FormEncType::FormDataEncoded,
"text/plain" => FormEncType::TextPlainEncoded,
"multipart/form-data" => FormEncType::MultipartFormData,
"text/plain" => FormEncType::TextPlain,
// https://html.spec.whatwg.org/multipage/#attr-fs-enctype
// urlencoded is the default
_ => FormEncType::UrlEncoded,