clippy: Fix map_flatten warning in components/script (#32110)

* clippy: Fix map_flatten warning

* refactor: Change plain comments to rustdoc comments
This commit is contained in:
Oluwatobi Sofela 2024-04-18 16:43:53 +01:00 committed by GitHub
parent f89c53bd51
commit 2a967119c7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -112,8 +112,7 @@ impl CSSRuleList {
let owner = self
.parent_stylesheet
.get_owner()
.map(DomRoot::downcast::<HTMLElement>)
.flatten();
.and_then(DomRoot::downcast::<HTMLElement>);
let loader = owner
.as_ref()
.map(|element| StylesheetLoader::for_element(element));
@ -135,7 +134,7 @@ impl CSSRuleList {
Ok(idx)
}
// In case of a keyframe rule, index must be valid.
/// In case of a keyframe rule, index must be valid.
pub fn remove_rule(&self, index: u32) -> ErrorResult {
let index = index as usize;
let mut guard = self.parent_stylesheet.shared_lock().write();
@ -163,7 +162,7 @@ impl CSSRuleList {
}
}
// Remove parent stylesheets from all children
/// Remove parent stylesheets from all children
pub fn deparent_all(&self) {
for rule in self.dom_rules.borrow().iter() {
if let Some(r) = rule.get() {