فهرست منبع

fix: use and_then

Jonathan Kelley 2 سال پیش
والد
کامیت
7beb7f0ee4
2فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 1 1
      packages/native-core/src/real_dom.rs
  2. 1 1
      packages/tui/src/widgets/mod.rs

+ 1 - 1
packages/native-core/src/real_dom.rs

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

+ 1 - 1
packages/tui/src/widgets/mod.rs

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