mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Diagnostic map semantics.
MozReview-Commit-ID: C0a5g6xMPY0
This commit is contained in:
parent
438b9df00c
commit
f5c5be00a7
11 changed files with 296 additions and 69 deletions
|
@ -159,6 +159,15 @@ impl<T> PerPseudoElementMap<T> {
|
|||
*self = Self::default();
|
||||
}
|
||||
|
||||
/// Invokes a callback on each non-None entry.
|
||||
pub fn for_each<F: FnMut(&mut T)>(&mut self, mut f: F) {
|
||||
for entry in self.entries.iter_mut() {
|
||||
if entry.is_some() {
|
||||
f(entry.as_mut().unwrap());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Set an entry value.
|
||||
///
|
||||
/// Returns an error if the element is not a simple pseudo.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue