fix: use and_then
This commit is contained in:
1 parent
36a8275540
commit
7beb7f0ee4
2 files changed
+2
-2
No files matched your search
@@ -306,7 +306,7 @@ impl<S: State> RealDom<S> {
|
||||
}
|
||||
mark_dirty(node_id, NodeMask::new().with_text(), &mut nodes_updated);
|
||||
}
|
||||
NewEventListener { name, scope: _, id } => {
|
||||
NewEventListener { name, id } => {
|
||||
let node_id = self.element_to_node_id(id);
|
||||
let node = self.tree.get_mut(node_id).unwrap();
|
||||
if let NodeType::Element { listeners, .. } = &mut node.node_data.node_type {
|
||||
|
||||
@@ -11,7 +11,7 @@ pub use input::*;
|
||||
|
||||
pub(crate) fn get_root_id<T>(cx: Scope<T>) -> Option<ElementId> {
|
||||
if let RenderReturn::Sync(Ok(sync)) = cx.root_node() {
|
||||
sync.root_ids.get(0).map(|id| id.get())
|
||||
sync.root_ids.get(0).and_then(|id| id.get())
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user