mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-27 06:30:20 +00:00
fix: use and_then
This commit is contained in:
parent
36a8275540
commit
7beb7f0ee4
2 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue