chore: clean up some clippy warnings and add clippy lints to CI

This commit is contained in:
Jonathan Kelley committed 2023-01-11 16:13:41 -08:00
1 parent e5b39bb61f
commit c4a18bc24d
12 files changed
+36 -313

No files matched your search

+2 -2
View File
@@ -10,7 +10,7 @@ fn main() {
fn app(cx: Scope) -> Element {
let window = use_window(cx);
let emails_sent = use_ref(cx, || vec![]);
let emails_sent = use_ref(cx, Vec::new);
let tx = use_coroutine(cx, |mut rx: UnboundedReceiver<String>| {
to_owned![emails_sent];
@@ -56,7 +56,7 @@ struct ComposeProps {
}
fn compose(cx: Scope<ComposeProps>) -> Element {
let user_input = use_state(cx, || String::new());
let user_input = use_state(cx, String::new);
let window = use_window(cx);
cx.render(rsx! {
-40
View File
@@ -1,40 +0,0 @@
//! This example shows to wrap a webcomponent / custom element with a component.
//!
//! Oftentimes, a third party library will provide a webcomponent that you want
//! to use in your application. This example shows how to create that custom element
//! directly with the raw_element method on NodeFactory.
use dioxus::prelude::*;
fn main() {
let mut dom = VirtualDom::new(app);
let _ = dom.rebuild();
let output = dioxus_ssr::render(&dom);
println!("{}", output);
}
fn app(cx: Scope) -> Element {
let g = cx.component(component, (), "component");
let c = cx.make_node(g);
cx.render(rsx! {
div { c }
})
// let nf = NodeFactory::new(cx);
// let mut attrs = dioxus::core::exports::bumpalo::collections::Vec::new_in(nf.bump());
// attrs.push(nf.attr("client-id", format_args!("abc123"), None, false));
// attrs.push(nf.attr("name", format_args!("bob"), None, false));
// attrs.push(nf.attr("age", format_args!("47"), None, false));
// Some(nf.raw_element("my-element", None, &[], attrs.into_bump_slice(), &[], None))
}
fn component(cx: Scope) -> Element {
todo!()
}
+1 -1
View File
@@ -10,7 +10,7 @@ fn main() {
static NAME: Atom<String> = |_| "world".to_string();
fn app(cx: Scope) -> Element {
use_init_atom_root(&cx);
use_init_atom_root(cx);
let name = use_read(cx, NAME);
cx.render(rsx! {
+1 -2
View File
@@ -1,12 +1,11 @@
use dioxus::prelude::*;
use dioxus_desktop::{use_window, WindowBuilder};
fn main() {
dioxus_desktop::launch(app);
}
fn app(cx: Scope) -> Element {
let window = use_window(cx);
let window = dioxus_desktop::use_window(cx);
cx.render(rsx! {
div {
+1 -1
View File
@@ -1,5 +1,5 @@
use dioxus::prelude::*;
use dioxus_desktop::{tao::dpi::PhysicalPosition, use_window, Config, LogicalSize, WindowBuilder};
use dioxus_desktop::{tao::dpi::PhysicalPosition, use_window, LogicalSize, WindowBuilder};
fn main() {
dioxus_desktop::launch_cfg(app, make_config());
+2
View File
@@ -1,3 +1,5 @@
#![allow(non_snake_case)]
use dioxus::prelude::*;
use dioxus_router::*;