borrowed.rs 510 B

123456789101112131415161718192021222324252627282930313233
  1. use dioxus::prelude::*;
  2. use dioxus_core as dioxus;
  3. use dioxus_core_macro::*;
  4. use dioxus_html as dioxus_elements;
  5. fn main() {}
  6. fn app(cx: Scope) -> Element {
  7. cx.render(rsx!(div {
  8. app2(
  9. p: "asd"
  10. )
  11. }))
  12. }
  13. #[derive(Props)]
  14. struct Borrowed<'a> {
  15. p: &'a str,
  16. }
  17. fn app2<'a>(cx: Scope<'a, Borrowed<'a>>) -> Element {
  18. let g = eat2(&cx);
  19. rsx!(cx, "")
  20. }
  21. fn eat2(s: &ScopeState) {}
  22. fn eat(f: &str) {}
  23. fn bleat() {
  24. let blah = String::from("asd");
  25. eat(&blah);
  26. }