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>
This commit is contained in:
Richard Dushime 2024-03-19 19:05:56 +03:00 committed by GitHub
parent 676f655647
commit 01ca220f83
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
41 changed files with 200 additions and 212 deletions

View file

@ -686,9 +686,7 @@ unsafe extern "C" fn get_size(obj: *mut JSObject) -> usize {
let mut ops = MallocSizeOfOps::new(servo_allocator::usable_size, None, None);
(v.malloc_size_of)(&mut ops, dom_object)
},
Err(_e) => {
return 0;
},
Err(_e) => 0,
}
}
@ -920,7 +918,7 @@ impl StreamConsumer {
pub fn consume_chunk(&self, stream: &[u8]) -> bool {
unsafe {
let stream_ptr = stream.as_ptr();
return StreamConsumerConsumeChunk(self.0, stream_ptr, stream.len());
StreamConsumerConsumeChunk(self.0, stream_ptr, stream.len())
}
}
@ -1041,7 +1039,7 @@ unsafe extern "C" fn consume_stream(
);
return false;
}
return true;
true
}
#[allow(unsafe_code)]