diff options
Diffstat (limited to 'components/script/dom/range.rs')
-rw-r--r-- | components/script/dom/range.rs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/components/script/dom/range.rs b/components/script/dom/range.rs index 0cf64e264d0..fa7d14795d3 100644 --- a/components/script/dom/range.rs +++ b/components/script/dom/range.rs @@ -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. |