fix: use and_then

This commit is contained in:
Jonathan Kelley 2022-12-13 15:30:40 -08:00
parent 36a8275540
commit 7beb7f0ee4
2 changed files with 2 additions and 2 deletions

View file

@ -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 {

View file

@ -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
}