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:
Emilio Cobos Álvarez 2017-08-22 15:57:13 +02:00
parent 15594dda10
commit 1c67a7dc14
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -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,