diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-08-22 15:57:13 +0200 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-08-23 09:30:47 +0200 |
commit | 1c67a7dc14b8b046d1b5c05e21cd7dc63a3aba32 (patch) | |
tree | 25070d522d4b03f3d4cc0a86edbfcc9b614b82a3 /components/style/stylesheet_set.rs | |
parent | 15594dda10880ad3a35fc76d535f2da18255530a (diff) | |
download | servo-1c67a7dc14b8b046d1b5c05e21cd7dc63a3aba32.tar.gz servo-1c67a7dc14b8b046d1b5c05e21cd7dc63a3aba32.zip |
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>
Diffstat (limited to 'components/style/stylesheet_set.rs')
-rw-r--r-- | components/style/stylesheet_set.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/components/style/stylesheet_set.rs b/components/style/stylesheet_set.rs index 386cc31c99f..104ada57783 100644 --- a/components/style/stylesheet_set.rs +++ b/components/style/stylesheet_set.rs @@ -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, |