mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
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:
parent
62a916ce5c
commit
df457c43c8
10 changed files with 28 additions and 71 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue