chore: remove all warnings
This commit is contained in:
1 parent
cea2e494e9
commit
4a3680ee1b
15 files changed
+17
-226
No files matched your search
@@ -1,8 +0,0 @@
|
|||||||
fn main() {
|
|
||||||
// use dioxus_core_macro::*;
|
|
||||||
// let r = html! {
|
|
||||||
// <div>
|
|
||||||
// "hello world"
|
|
||||||
// </div>
|
|
||||||
// };
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
use dioxus_core_macro::{inline_props, Props};
|
|
||||||
|
|
||||||
fn main() {}
|
|
||||||
|
|
||||||
type Element<'a> = ();
|
|
||||||
|
|
||||||
pub struct Scope<'a, T = ()> {
|
|
||||||
props: &'a T,
|
|
||||||
}
|
|
||||||
|
|
||||||
// #[inline_props]
|
|
||||||
pub fn component<'a>(
|
|
||||||
cx: Scope<'a>,
|
|
||||||
chkk: String,
|
|
||||||
chkk2: String,
|
|
||||||
r: u32,
|
|
||||||
cat: &'a str,
|
|
||||||
drd: String,
|
|
||||||
e: String,
|
|
||||||
) -> Element<'a> {
|
|
||||||
let r = chkk.len();
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
fn main() {}
|
|
||||||
|
|
||||||
pub mod dioxus {
|
|
||||||
pub mod prelude {
|
|
||||||
pub trait Properties {
|
|
||||||
type Builder;
|
|
||||||
const IS_STATIC: bool;
|
|
||||||
fn builder() -> Self::Builder;
|
|
||||||
unsafe fn memoize(&self, other: &Self) -> bool;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// This implementation should require a "PartialEq" because it memoizes (no external references)
|
|
||||||
#[derive(PartialEq, dioxus_core_macro::Props)]
|
|
||||||
struct SomeProps {
|
|
||||||
a: String,
|
|
||||||
}
|
|
||||||
|
|
||||||
/// This implementation does not require a "PartialEq" because it does not memoize
|
|
||||||
#[derive(dioxus_core_macro::Props)]
|
|
||||||
struct SomePropsTwo<'a> {
|
|
||||||
_a: &'a str,
|
|
||||||
}
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
use dioxus::prelude::*;
|
|
||||||
use dioxus_core as dioxus;
|
|
||||||
use dioxus_core_macro::*;
|
|
||||||
use dioxus_html as dioxus_elements;
|
|
||||||
|
|
||||||
fn main() {}
|
|
||||||
|
|
||||||
fn app(cx: Scope) -> Element {
|
|
||||||
cx.render(rsx!(div {
|
|
||||||
app2(
|
|
||||||
p: "asd"
|
|
||||||
)
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Props)]
|
|
||||||
struct Borrowed<'a> {
|
|
||||||
p: &'a str,
|
|
||||||
}
|
|
||||||
|
|
||||||
fn app2<'a>(cx: Scope<'a, Borrowed<'a>>) -> Element {
|
|
||||||
let g = eat2(&cx);
|
|
||||||
rsx!(cx, "")
|
|
||||||
}
|
|
||||||
|
|
||||||
fn eat2(s: &ScopeState) {}
|
|
||||||
|
|
||||||
fn eat(f: &str) {}
|
|
||||||
|
|
||||||
fn bleat() {
|
|
||||||
let blah = String::from("asd");
|
|
||||||
eat(&blah);
|
|
||||||
}
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
#![allow(non_snake_case)]
|
|
||||||
|
|
||||||
use dioxus::prelude::*;
|
|
||||||
use dioxus_core as dioxus;
|
|
||||||
use dioxus_core_macro::*;
|
|
||||||
use dioxus_html as dioxus_elements;
|
|
||||||
|
|
||||||
fn main() {
|
|
||||||
let mut dom = VirtualDom::new(parent);
|
|
||||||
let edits = dom.rebuild();
|
|
||||||
dbg!(edits);
|
|
||||||
}
|
|
||||||
|
|
||||||
fn parent(cx: Scope) -> Element {
|
|
||||||
let value = cx.use_hook(|_| String::new());
|
|
||||||
|
|
||||||
cx.render(rsx! {
|
|
||||||
div {
|
|
||||||
child(
|
|
||||||
name: value,
|
|
||||||
h1 {"hi"}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Props)]
|
|
||||||
struct ChildProps<'a> {
|
|
||||||
name: &'a str,
|
|
||||||
children: Element<'a>,
|
|
||||||
}
|
|
||||||
|
|
||||||
fn child<'a>(cx: Scope<'a, ChildProps<'a>>) -> Element {
|
|
||||||
cx.render(rsx! {
|
|
||||||
div {
|
|
||||||
"it's nested {cx.props.name}",
|
|
||||||
&cx.props.children
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
use dioxus::prelude::*;
|
|
||||||
use dioxus_core as dioxus;
|
|
||||||
use dioxus_core_macro::*;
|
|
||||||
use dioxus_html as dioxus_elements;
|
|
||||||
|
|
||||||
// very tiny hello world
|
|
||||||
fn main() {
|
|
||||||
dioxus::VirtualDom::new(|cx| rsx!(cx, "hello world"));
|
|
||||||
}
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
#![allow(non_snake_case)]
|
|
||||||
|
|
||||||
use dioxus::prelude::*;
|
|
||||||
use dioxus_core as dioxus;
|
|
||||||
use dioxus_core_macro::*;
|
|
||||||
use dioxus_html as dioxus_elements;
|
|
||||||
|
|
||||||
fn main() {
|
|
||||||
let _ = VirtualDom::new(parent);
|
|
||||||
}
|
|
||||||
|
|
||||||
fn parent(cx: Scope) -> Element {
|
|
||||||
let value = cx.use_hook(|_| String::new());
|
|
||||||
|
|
||||||
cx.render(rsx! {
|
|
||||||
div {
|
|
||||||
child( name: value )
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Props)]
|
|
||||||
struct ChildProps<'a> {
|
|
||||||
name: &'a str,
|
|
||||||
}
|
|
||||||
|
|
||||||
fn child<'a>(cx: Scope<'a, ChildProps<'a>>) -> Element {
|
|
||||||
cx.render(rsx! {
|
|
||||||
div {
|
|
||||||
h1 { "it's nested" }
|
|
||||||
grandchild( name: cx.props.name )
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Props)]
|
|
||||||
struct Grandchild<'a> {
|
|
||||||
name: &'a str,
|
|
||||||
}
|
|
||||||
|
|
||||||
fn grandchild<'a>(cx: Scope<'a, Grandchild>) -> Element<'a> {
|
|
||||||
cx.render(rsx! {
|
|
||||||
div { "Hello {cx.props.name}!" }
|
|
||||||
great_grandchild( name: cx.props.name )
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
fn great_grandchild<'a>(cx: Scope<'a, Grandchild>) -> Element<'a> {
|
|
||||||
cx.render(rsx! {
|
|
||||||
div {
|
|
||||||
h1 { "it's nested" }
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
#![allow(unused, non_upper_case_globals)]
|
#![allow(unused, non_upper_case_globals)]
|
||||||
|
#![allow(non_snake_case)]
|
||||||
|
|
||||||
//! Tests for the lifecycle of components.
|
//! Tests for the lifecycle of components.
|
||||||
use dioxus::prelude::*;
|
use dioxus::prelude::*;
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#![allow(non_snake_case)]
|
||||||
/*
|
/*
|
||||||
Stress Miri as much as possible.
|
Stress Miri as much as possible.
|
||||||
|
|
||||||
@@ -311,22 +312,11 @@ fn leak_thru_children() {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_pass_thru() {
|
fn test_pass_thru() {
|
||||||
#[inline_props]
|
|
||||||
fn Router<'a>(cx: Scope, children: Element<'a>) -> Element {
|
|
||||||
cx.render(rsx! {
|
|
||||||
div {
|
|
||||||
&cx.props.children
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline_props]
|
#[inline_props]
|
||||||
fn NavContainer<'a>(cx: Scope, children: Element<'a>) -> Element {
|
fn NavContainer<'a>(cx: Scope, children: Element<'a>) -> Element {
|
||||||
cx.render(rsx! {
|
cx.render(rsx! {
|
||||||
header {
|
header {
|
||||||
nav {
|
nav { children }
|
||||||
&cx.props.children
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -365,9 +355,9 @@ fn test_pass_thru() {
|
|||||||
class: "columns is-mobile",
|
class: "columns is-mobile",
|
||||||
div {
|
div {
|
||||||
class: "column is-full",
|
class: "column is-full",
|
||||||
&cx.props.nav,
|
nav,
|
||||||
&cx.props.body,
|
body,
|
||||||
&cx.props.footer,
|
footer,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -398,7 +388,7 @@ fn test_pass_thru() {
|
|||||||
let mut dom = new_dom(app, ());
|
let mut dom = new_dom(app, ());
|
||||||
let _ = dom.rebuild();
|
let _ = dom.rebuild();
|
||||||
|
|
||||||
for x in 0..40 {
|
for _ in 0..40 {
|
||||||
dom.handle_message(SchedulerMsg::Immediate(ScopeId(0)));
|
dom.handle_message(SchedulerMsg::Immediate(ScopeId(0)));
|
||||||
dom.work_with_deadline(|| false);
|
dom.work_with_deadline(|| false);
|
||||||
dom.handle_message(SchedulerMsg::Immediate(ScopeId(0)));
|
dom.handle_message(SchedulerMsg::Immediate(ScopeId(0)));
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#![allow(unused, non_upper_case_globals)]
|
#![allow(unused, non_upper_case_globals)]
|
||||||
|
#![allow(non_snake_case)]
|
||||||
|
|
||||||
//! Diffing Tests
|
//! Diffing Tests
|
||||||
//!
|
//!
|
||||||
@@ -40,9 +41,7 @@ fn nested_passthru_creates() {
|
|||||||
|
|
||||||
#[inline_props]
|
#[inline_props]
|
||||||
fn Child<'a>(cx: Scope, children: Element<'a>) -> Element {
|
fn Child<'a>(cx: Scope, children: Element<'a>) -> Element {
|
||||||
cx.render(rsx! {
|
cx.render(rsx! { children })
|
||||||
children
|
|
||||||
})
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut dom = VirtualDom::new(app);
|
let mut dom = VirtualDom::new(app);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#![allow(unused, non_upper_case_globals)]
|
#![allow(unused, non_upper_case_globals, non_snake_case)]
|
||||||
|
|
||||||
use dioxus::{prelude::*, DomEdit, Mutations, SchedulerMsg, ScopeId};
|
use dioxus::{prelude::*, DomEdit, Mutations, SchedulerMsg, ScopeId};
|
||||||
use dioxus_core as dioxus;
|
use dioxus_core as dioxus;
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
#![allow(clippy::unused_unit, non_upper_case_globals)]
|
||||||
|
|
||||||
use js_sys::Function;
|
use js_sys::Function;
|
||||||
use wasm_bindgen::prelude::*;
|
use wasm_bindgen::prelude::*;
|
||||||
use web_sys::{Element, Node};
|
use web_sys::{Element, Node};
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
|
#![allow(non_snake_case)]
|
||||||
|
|
||||||
use dioxus_core::prelude::*;
|
use dioxus_core::prelude::*;
|
||||||
use dioxus_core_macro::*;
|
use dioxus_core_macro::*;
|
||||||
use dioxus_html as dioxus_elements;
|
use dioxus_html as dioxus_elements;
|
||||||
use dioxus_router::*;
|
use dioxus_router::*;
|
||||||
use serde::{Deserialize, Serialize};
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
console_error_panic_hook::set_once();
|
console_error_panic_hook::set_once();
|
||||||
@@ -25,26 +26,17 @@ static APP: Component = |cx| {
|
|||||||
|
|
||||||
fn Home(cx: Scope) -> Element {
|
fn Home(cx: Scope) -> Element {
|
||||||
cx.render(rsx! {
|
cx.render(rsx! {
|
||||||
div {
|
h1 { "Home" }
|
||||||
h1 { "Home" }
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fn BlogList(cx: Scope) -> Element {
|
fn BlogList(cx: Scope) -> Element {
|
||||||
cx.render(rsx! {
|
cx.render(rsx! {
|
||||||
div {
|
div { "Blog List" }
|
||||||
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fn BlogPost(cx: Scope) -> Element {
|
fn BlogPost(cx: Scope) -> Element {
|
||||||
let id = use_route(&cx).segment::<usize>("id")?;
|
let id = use_route(&cx).segment::<usize>("id")?;
|
||||||
|
cx.render(rsx! { div { "{id:?}" } })
|
||||||
cx.render(rsx! {
|
|
||||||
div {
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,6 @@
|
|||||||
use dioxus_core as dioxus;
|
|
||||||
use dioxus_core::prelude::*;
|
use dioxus_core::prelude::*;
|
||||||
use dioxus_core_macro::*;
|
use dioxus_core_macro::*;
|
||||||
use dioxus_html as dioxus_elements;
|
use dioxus_html as dioxus_elements;
|
||||||
use wasm_bindgen_test::wasm_bindgen_test;
|
|
||||||
use web_sys::window;
|
use web_sys::window;
|
||||||
|
|
||||||
fn app(cx: Scope) -> Element {
|
fn app(cx: Scope) -> Element {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
use dioxus_core as dioxus;
|
|
||||||
use dioxus_core::prelude::*;
|
use dioxus_core::prelude::*;
|
||||||
use dioxus_core_macro::*;
|
use dioxus_core_macro::*;
|
||||||
use dioxus_html as dioxus_elements;
|
use dioxus_html as dioxus_elements;
|
||||||
|
|||||||
Reference in new issue
Block a user