clippy: Fix needless borrow warnings (#31813)

This commit is contained in:
Oluwatobi Sofela 2024-03-21 18:48:54 +01:00 committed by GitHub
parent 694e86ecff
commit 3e63f8d6ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
42 changed files with 151 additions and 157 deletions

View file

@ -453,7 +453,7 @@ impl Extractable for BodyInit {
BodyInit::ArrayBuffer(ref typedarray) => {
let bytes = typedarray.to_vec();
let total_bytes = bytes.len();
let stream = ReadableStream::new_from_bytes(&global, bytes);
let stream = ReadableStream::new_from_bytes(global, bytes);
Ok(ExtractedBody {
stream,
total_bytes: Some(total_bytes),
@ -464,7 +464,7 @@ impl Extractable for BodyInit {
BodyInit::ArrayBufferView(ref typedarray) => {
let bytes = typedarray.to_vec();
let total_bytes = bytes.len();
let stream = ReadableStream::new_from_bytes(&global, bytes);
let stream = ReadableStream::new_from_bytes(global, bytes);
Ok(ExtractedBody {
stream,
total_bytes: Some(total_bytes),
@ -497,7 +497,7 @@ impl Extractable for Vec<u8> {
fn extract(&self, global: &GlobalScope) -> Fallible<ExtractedBody> {
let bytes = self.clone();
let total_bytes = self.len();
let stream = ReadableStream::new_from_bytes(&global, bytes);
let stream = ReadableStream::new_from_bytes(global, bytes);
Ok(ExtractedBody {
stream,
total_bytes: Some(total_bytes),
@ -531,7 +531,7 @@ impl Extractable for DOMString {
let bytes = self.as_bytes().to_owned();
let total_bytes = bytes.len();
let content_type = Some(DOMString::from("text/plain;charset=UTF-8"));
let stream = ReadableStream::new_from_bytes(&global, bytes);
let stream = ReadableStream::new_from_bytes(global, bytes);
Ok(ExtractedBody {
stream,
total_bytes: Some(total_bytes),
@ -550,7 +550,7 @@ impl Extractable for FormData {
"multipart/form-data;boundary={}",
boundary
)));
let stream = ReadableStream::new_from_bytes(&global, bytes);
let stream = ReadableStream::new_from_bytes(global, bytes);
Ok(ExtractedBody {
stream,
total_bytes: Some(total_bytes),
@ -567,7 +567,7 @@ impl Extractable for URLSearchParams {
let content_type = Some(DOMString::from(
"application/x-www-form-urlencoded;charset=UTF-8",
));
let stream = ReadableStream::new_from_bytes(&global, bytes);
let stream = ReadableStream::new_from_bytes(global, bytes);
Ok(ExtractedBody {
stream,
total_bytes: Some(total_bytes),