aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/xmlhttprequest.rs
diff options
context:
space:
mode:
authorRichard Dushime <45734838+richarddushime@users.noreply.github.com>2024-03-19 19:05:56 +0300
committerGitHub <noreply@github.com>2024-03-19 16:05:56 +0000
commit01ca220f83f549d03da566f4becdf826819747ae (patch)
tree43e7fb2dda3e536ce7e0d0427739a2fd70b78deb /components/script/dom/xmlhttprequest.rs
parent676f655647fe261c9a9f005122cbbca0263a2625 (diff)
downloadservo-01ca220f83f549d03da566f4becdf826819747ae.tar.gz
servo-01ca220f83f549d03da566f4becdf826819747ae.zip
clippy: Fix many warnings in `components/script` (#31717)
* Fix Several clippy warnings * Fix Build errors * Fix Unused import * Fix requested changes * Fix rustfmt * Minor fixes --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Diffstat (limited to 'components/script/dom/xmlhttprequest.rs')
-rw-r--r--components/script/dom/xmlhttprequest.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/components/script/dom/xmlhttprequest.rs b/components/script/dom/xmlhttprequest.rs
index e9440ce6b2f..c7cd7af59ee 100644
--- a/components/script/dom/xmlhttprequest.rs
+++ b/components/script/dom/xmlhttprequest.rs
@@ -463,7 +463,7 @@ impl XMLHttpRequestMethods for XMLHttpRequest {
let value = trim_http_whitespace(&value);
// Step 4
- if !is_token(&name) || !is_field_value(&value) {
+ if !is_token(&name) || !is_field_value(value) {
return Err(Error::Syntax);
}
let name_lower = name.to_lower();
@@ -578,7 +578,7 @@ impl XMLHttpRequestMethods for XMLHttpRequest {
// Step 4 (first half)
let mut extracted_or_serialized = match data {
Some(DocumentOrXMLHttpRequestBodyInit::Document(ref doc)) => {
- let bytes = Vec::from(serialize_document(&doc)?.as_ref());
+ let bytes = Vec::from(serialize_document(doc)?.as_ref());
let content_type = if doc.is_html_document() {
"text/html;charset=UTF-8"
} else {
@@ -1436,7 +1436,7 @@ impl XMLHttpRequest {
// Step 12
self.response_xml.set(Some(&temp_doc));
- return self.response_xml.get();
+ self.response_xml.get()
}
#[allow(unsafe_code)]
@@ -1620,7 +1620,7 @@ impl XMLHttpRequest {
// 8. Return encoding.
override_charset
.or(response_charset)
- .and_then(|charset| Encoding::for_label(&charset.as_bytes()))
+ .and_then(|charset| Encoding::for_label(charset.as_bytes()))
}
/// <https://xhr.spec.whatwg.org/#response-mime-type>
@@ -1641,7 +1641,7 @@ impl XMLHttpRequest {
if self.override_mime_type.borrow().is_some() {
self.override_mime_type.borrow().clone()
} else {
- return self.response_mime_type();
+ self.response_mime_type()
}
}
}