mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Simplify extracting a reference from an Option<Root<T>>, per review comments.
This commit is contained in:
parent
5713867778
commit
9de42c8935
2 changed files with 3 additions and 3 deletions
|
@ -297,7 +297,7 @@ impl Document {
|
||||||
.filter_map(HTMLBaseElementCast::to_root)
|
.filter_map(HTMLBaseElementCast::to_root)
|
||||||
.filter(|element| ElementCast::from_ref(&**element).has_attribute(&atom!("href")))
|
.filter(|element| ElementCast::from_ref(&**element).has_attribute(&atom!("href")))
|
||||||
.next();
|
.next();
|
||||||
self.base_element.set(base.as_ref().map(Root::r));
|
self.base_element.set(base.r());
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn quirks_mode(&self) -> QuirksMode {
|
pub fn quirks_mode(&self) -> QuirksMode {
|
||||||
|
|
|
@ -6,7 +6,7 @@ use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods;
|
||||||
use dom::bindings::codegen::Bindings::NodeListBinding;
|
use dom::bindings::codegen::Bindings::NodeListBinding;
|
||||||
use dom::bindings::codegen::Bindings::NodeListBinding::NodeListMethods;
|
use dom::bindings::codegen::Bindings::NodeListBinding::NodeListMethods;
|
||||||
use dom::bindings::global::GlobalRef;
|
use dom::bindings::global::GlobalRef;
|
||||||
use dom::bindings::js::{JS, MutNullableHeap, Root};
|
use dom::bindings::js::{JS, MutNullableHeap, Root, RootedReference};
|
||||||
use dom::bindings::utils::{Reflector, reflect_dom_object};
|
use dom::bindings::utils::{Reflector, reflect_dom_object};
|
||||||
use dom::node::{ChildrenMutation, Node};
|
use dom::node::{ChildrenMutation, Node};
|
||||||
use dom::window::Window;
|
use dom::window::Window;
|
||||||
|
@ -103,7 +103,7 @@ impl ChildrenList {
|
||||||
let last_visited = node.GetFirstChild();
|
let last_visited = node.GetFirstChild();
|
||||||
ChildrenList {
|
ChildrenList {
|
||||||
node: JS::from_ref(node),
|
node: JS::from_ref(node),
|
||||||
last_visited: MutNullableHeap::new(last_visited.as_ref().map(Root::r)),
|
last_visited: MutNullableHeap::new(last_visited.r()),
|
||||||
last_index: Cell::new(0u32),
|
last_index: Cell::new(0u32),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue