Fixed some clippy warning by adding default implementations (#31989)

* Fixed some clippy warning by adding default implementations

* Updated PR that adds default implementation of structs

* Clean up and extend `Default` implementations

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
komuhangi 2024-04-04 12:33:30 +03:00 committed by GitHub
parent 62a916ce5c
commit df457c43c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 28 additions and 71 deletions

View file

@ -1082,13 +1082,19 @@ pub struct WeakRangeVec {
cell: UnsafeCell<WeakRefVec<Range>>,
}
impl Default for WeakRangeVec {
fn default() -> Self {
WeakRangeVec {
cell: UnsafeCell::new(WeakRefVec::new()),
}
}
}
#[allow(unsafe_code)]
impl WeakRangeVec {
/// Create a new vector of weak references.
pub fn new() -> Self {
WeakRangeVec {
cell: UnsafeCell::new(WeakRefVec::new()),
}
Self::default()
}
/// Whether that vector of ranges is empty.