mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
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:
parent
f89c53bd51
commit
2a967119c7
1 changed files with 3 additions and 4 deletions
|
@ -112,8 +112,7 @@ impl CSSRuleList {
|
||||||
let owner = self
|
let owner = self
|
||||||
.parent_stylesheet
|
.parent_stylesheet
|
||||||
.get_owner()
|
.get_owner()
|
||||||
.map(DomRoot::downcast::<HTMLElement>)
|
.and_then(DomRoot::downcast::<HTMLElement>);
|
||||||
.flatten();
|
|
||||||
let loader = owner
|
let loader = owner
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.map(|element| StylesheetLoader::for_element(element));
|
.map(|element| StylesheetLoader::for_element(element));
|
||||||
|
@ -135,7 +134,7 @@ impl CSSRuleList {
|
||||||
Ok(idx)
|
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 {
|
pub fn remove_rule(&self, index: u32) -> ErrorResult {
|
||||||
let index = index as usize;
|
let index = index as usize;
|
||||||
let mut guard = self.parent_stylesheet.shared_lock().write();
|
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) {
|
pub fn deparent_all(&self) {
|
||||||
for rule in self.dom_rules.borrow().iter() {
|
for rule in self.dom_rules.borrow().iter() {
|
||||||
if let Some(r) = rule.get() {
|
if let Some(r) = rule.get() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue