remove more lifetimes
This commit is contained in:
1 parent
3ad16ddd37
commit
f42ef3ef9d
18 files changed
+241
-421
No files matched your search
@@ -14,10 +14,10 @@ fn app(cx: Scope) -> Element {
|
||||
|
||||
#[derive(Props)]
|
||||
struct Testing<'a> {
|
||||
borrowed: &'a RefCell<Vec<Element<'a>>>,
|
||||
borrowed: &'a RefCell<Vec<Element>>,
|
||||
}
|
||||
|
||||
fn unsafe_child_component<'a>(cx: Scope<'a, Testing<'a>>) -> Element<'a> {
|
||||
fn unsafe_child_component<'a>(cx: Scope<'a, Testing<'a>>) -> Element {
|
||||
let Testing { borrowed } = cx.props;
|
||||
let borrowed_temporary_data =
|
||||
cx.use_hook(|| String::from("This data is only valid for the lifetime of the child"));
|
||||
|
||||
@@ -17,7 +17,7 @@ struct Testing<'a> {
|
||||
borrowed: &'a Vec<u32>,
|
||||
}
|
||||
|
||||
fn unsafe_child_component<'a>(cx: Scope<'a, Testing<'a>>) -> Element<'a> {
|
||||
fn unsafe_child_component<'a>(cx: Scope<'a, Testing<'a>>) -> Element {
|
||||
cx.render(rsx! {
|
||||
div { "{cx.props.borrowed:?}" }
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user