mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
style: Ensure the flusher is completely consumed before getting dropped.
This will be necessary for future patches. MozReview-Commit-ID: FgWaoRCMdw2 Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
This commit is contained in:
parent
15594dda10
commit
1c67a7dc14
1 changed files with 14 additions and 0 deletions
|
@ -90,6 +90,20 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(debug_assertions)]
|
||||
impl<'a, 'b, S> Drop for StylesheetFlusher<'a, 'b, S>
|
||||
where
|
||||
'b: 'a,
|
||||
S: StylesheetInDocument + PartialEq + 'static,
|
||||
{
|
||||
fn drop(&mut self) {
|
||||
debug_assert!(
|
||||
self.iter.next().is_none(),
|
||||
"You're supposed to fully consume the flusher",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'b, S> Iterator for StylesheetFlusher<'a, 'b, S>
|
||||
where
|
||||
'b: 'a,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue