Browse Source

chore: make cargo check happy with new apis

Jonathan Kelley 2 years ago
parent
commit
db5b65b6cb

+ 2 - 1
packages/core/src/events.rs

@@ -21,7 +21,8 @@ use std::{
 /// }
 /// ```
 pub struct Event<T: 'static + ?Sized> {
-    pub(crate) data: Rc<T>,
+    /// The data associated with this event
+    pub data: Rc<T>,
     pub(crate) propogates: Rc<Cell<bool>>,
 }
 

+ 2 - 2
packages/hooks/src/useeffect.rs

@@ -77,12 +77,12 @@ mod tests {
             });
 
             // runs when a is changed
-            use_effect(cx, (cx.props.a,), |(a,)| async move {
+            use_effect(cx, (&cx.props.a,), |(a,)| async move {
                 //
             });
 
             // runs when a or b is changed
-            use_effect(cx, (cx.props.a, &cx.props.b), |(a, b)| async move {
+            use_effect(cx, (&cx.props.a, &cx.props.b), |(a, b)| async move {
                 //
             });
 

+ 2 - 2
packages/hooks/src/usefuture.rs

@@ -319,10 +319,10 @@ mod tests {
             let fut = use_future(cx, (), |_| async move {});
 
             // runs when a is changed
-            let fut = use_future(cx, (cx.props.a,), |(a,)| async move {});
+            let fut = use_future(cx, (&cx.props.a,), |(a,)| async move {});
 
             // runs when a or b is changed
-            let fut = use_future(cx, (cx.props.a, &cx.props.b), |(a, b)| async move { 123 });
+            let fut = use_future(cx, (&cx.props.a, &cx.props.b), |(a, b)| async move { 123 });
 
             let a = use_future!(cx, || async move {
                 // do the thing!

+ 0 - 1
packages/native-core-macro/tests/called_minimally_on_build.rs

@@ -1,4 +1,3 @@
-use anymap::AnyMap;
 use dioxus::prelude::*;
 use dioxus_native_core::node_ref::*;
 use dioxus_native_core::real_dom::*;

+ 1 - 3
packages/native-core-macro/tests/update_state.rs

@@ -1,10 +1,8 @@
-use dioxus::core::ElementId;
-use dioxus::core::{AttributeValue, Mutations};
 use dioxus::prelude::*;
 use dioxus_native_core::real_dom::*;
 use dioxus_native_core::state::{ChildDepState, NodeDepState, ParentDepState, State};
 use dioxus_native_core::tree::TreeView;
-use dioxus_native_core::{node_ref::*, NodeId, RealNodeId, SendAnyMap};
+use dioxus_native_core::{node_ref::*, NodeId, SendAnyMap};
 use dioxus_native_core_macro::State;
 
 #[derive(Debug, Clone, Default, State)]

+ 0 - 91
packages/tui/tests/margin.rs

@@ -1,91 +0,0 @@
-#[test]
-fn margin_and_flex_row() {
-    let mut taffy = taffy::Taffy::new();
-    let node0 = taffy
-        .new_node(
-            taffy::style::Style {
-                flex_grow: 1f32,
-                margin: taffy::geometry::Rect {
-                    start: taffy::style::Dimension::Points(10f32),
-                    end: taffy::style::Dimension::Points(10f32),
-                    ..Default::default()
-                },
-                ..Default::default()
-            },
-            &[],
-        )
-        .unwrap();
-    let node = taffy
-        .new_node(
-            taffy::style::Style {
-                size: taffy::geometry::Size {
-                    width: taffy::style::Dimension::Points(100f32),
-                    height: taffy::style::Dimension::Points(100f32),
-                },
-                ..Default::default()
-            },
-            &[node0],
-        )
-        .unwrap();
-    taffy
-        .compute_layout(node, taffy::geometry::Size::undefined())
-        .unwrap();
-    assert_eq!(taffy.layout(node).unwrap().size.width, 100f32);
-    assert_eq!(taffy.layout(node).unwrap().size.height, 100f32);
-    assert_eq!(taffy.layout(node).unwrap().location.x, 0f32);
-    assert_eq!(taffy.layout(node).unwrap().location.y, 0f32);
-    assert_eq!(taffy.layout(node0).unwrap().size.width, 80f32);
-    assert_eq!(taffy.layout(node0).unwrap().size.height, 100f32);
-    assert_eq!(taffy.layout(node0).unwrap().location.x, 10f32);
-    assert_eq!(taffy.layout(node0).unwrap().location.y, 0f32);
-}
-
-#[test]
-fn margin_and_flex_row2() {
-    let mut taffy = taffy::Taffy::new();
-    let node0 = taffy
-        .new_node(
-            taffy::style::Style {
-                flex_grow: 1f32,
-                margin: taffy::geometry::Rect {
-                    // left
-                    start: taffy::style::Dimension::Points(10f32),
-
-                    // right?
-                    end: taffy::style::Dimension::Points(10f32),
-
-                    // top?
-                    // top: taffy::style::Dimension::Points(10f32),
-
-                    // bottom?
-                    // bottom: taffy::style::Dimension::Points(10f32),
-                    ..Default::default()
-                },
-                ..Default::default()
-            },
-            &[],
-        )
-        .unwrap();
-
-    let node = taffy
-        .new_node(
-            taffy::style::Style {
-                size: taffy::geometry::Size {
-                    width: taffy::style::Dimension::Points(100f32),
-                    height: taffy::style::Dimension::Points(100f32),
-                },
-                ..Default::default()
-            },
-            &[node0],
-        )
-        .unwrap();
-
-    taffy
-        .compute_layout(node, taffy::geometry::Size::undefined())
-        .unwrap();
-
-    assert_eq!(taffy.layout(node).unwrap().size.width, 100f32);
-    assert_eq!(taffy.layout(node).unwrap().size.height, 100f32);
-    assert_eq!(taffy.layout(node).unwrap().location.x, 0f32);
-    assert_eq!(taffy.layout(node).unwrap().location.y, 0f32);
-}

+ 1 - 1
packages/web/tests/hydrate.rs

@@ -50,7 +50,7 @@ fn rehydrates() {
 
     let mut dom = VirtualDom::new(app);
     let _ = dom.rebuild();
-    let out = dioxus_ssr::render_vdom_cfg(&dom, Default::default());
+    let out = dioxus_ssr::render(&dom);
 
     window()
         .unwrap()