chore: make cargo check happy with new apis
This commit is contained in:
1 parent
a252774226
commit
db5b65b6cb
7 files changed
+8
-101
No files matched your search
@@ -21,7 +21,8 @@ use std::{
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
pub struct Event<T: 'static + ?Sized> {
|
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>>,
|
pub(crate) propogates: Rc<Cell<bool>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -77,12 +77,12 @@ mod tests {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// runs when a is changed
|
// 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
|
// 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 {
|
||||||
//
|
//
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -319,10 +319,10 @@ mod tests {
|
|||||||
let fut = use_future(cx, (), |_| async move {});
|
let fut = use_future(cx, (), |_| async move {});
|
||||||
|
|
||||||
// runs when a is changed
|
// 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
|
// 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 {
|
let a = use_future!(cx, || async move {
|
||||||
// do the thing!
|
// do the thing!
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
use anymap::AnyMap;
|
|
||||||
use dioxus::prelude::*;
|
use dioxus::prelude::*;
|
||||||
use dioxus_native_core::node_ref::*;
|
use dioxus_native_core::node_ref::*;
|
||||||
use dioxus_native_core::real_dom::*;
|
use dioxus_native_core::real_dom::*;
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
use dioxus::core::ElementId;
|
|
||||||
use dioxus::core::{AttributeValue, Mutations};
|
|
||||||
use dioxus::prelude::*;
|
use dioxus::prelude::*;
|
||||||
use dioxus_native_core::real_dom::*;
|
use dioxus_native_core::real_dom::*;
|
||||||
use dioxus_native_core::state::{ChildDepState, NodeDepState, ParentDepState, State};
|
use dioxus_native_core::state::{ChildDepState, NodeDepState, ParentDepState, State};
|
||||||
use dioxus_native_core::tree::TreeView;
|
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;
|
use dioxus_native_core_macro::State;
|
||||||
|
|
||||||
#[derive(Debug, Clone, Default, State)]
|
#[derive(Debug, Clone, Default, State)]
|
||||||
|
|||||||
@@ -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);
|
|
||||||
}
|
|
||||||
@@ -50,7 +50,7 @@ fn rehydrates() {
|
|||||||
|
|
||||||
let mut dom = VirtualDom::new(app);
|
let mut dom = VirtualDom::new(app);
|
||||||
let _ = dom.rebuild();
|
let _ = dom.rebuild();
|
||||||
let out = dioxus_ssr::render_vdom_cfg(&dom, Default::default());
|
let out = dioxus_ssr::render(&dom);
|
||||||
|
|
||||||
window()
|
window()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
|
|||||||
Reference in new issue
Block a user