fix clippy

This commit is contained in:
Evan Almloff committed 2023-01-27 20:35:46 -06:00
1 parent 624f32115b
commit b6c7d44a27
37 files changed
+96 -107

No files matched your search

+1 -1
View File
@@ -82,7 +82,7 @@ fn app(cx: Scope) -> Element {
onclick: move |_| {
let temp = calc_val(val.as_str());
if temp > 0.0 {
val.set(format!("-{}", temp));
val.set(format!("-{temp}"));
} else {
val.set(format!("{}", temp.abs()));
}
+1 -1
View File
@@ -13,7 +13,7 @@ fn app(cx: Scope) -> Element {
.await
.unwrap();
println!("{:#?}, ", res);
println!("{res:#?}, ");
});
cx.render(rsx! {
+1 -1
View File
@@ -18,7 +18,7 @@ fn app(cx: Scope) -> Element {
loop {
tokio::time::sleep(std::time::Duration::from_millis(100)).await;
count += 1;
println!("current: {}", count);
println!("current: {count}");
}
});
+1 -1
View File
@@ -52,7 +52,7 @@ struct DogApi {
#[inline_props]
async fn breed_pic(cx: Scope, breed: String) -> Element {
let fut = use_future!(cx, |breed| async move {
reqwest::get(format!("https://dog.ceo/api/breed/{}/images/random", breed))
reqwest::get(format!("https://dog.ceo/api/breed/{breed}/images/random"))
.await
.unwrap()
.json::<DogApi>()
+1 -1
View File
@@ -89,7 +89,7 @@ impl Files {
let paths = match std::fs::read_dir(cur_path) {
Ok(e) => e,
Err(err) => {
let err = format!("An error occured: {:?}", err);
let err = format!("An error occured: {err:?}");
self.err = Some(err);
self.path_stack.pop();
return;
+1 -1
View File
@@ -3,7 +3,7 @@ use dioxus_desktop::Config;
fn main() {
let cfg = Config::new().with_file_drop_handler(|_w, e| {
println!("{:?}", e);
println!("{e:?}");
true
});
+3 -3
View File
@@ -42,7 +42,7 @@ fn app(cx: Scope) -> Element {
// so the value of our input event will be either huey, dewey, louie, or true/false (because of the checkboxe)
// be mindful in grouping inputs together, as they will all be handled by the same event handler
oninput: move |evt| {
println!("{:?}", evt);
println!("{evt:?}");
},
div {
input {
@@ -104,7 +104,7 @@ fn app(cx: Scope) -> Element {
name: "pdf",
r#type: "checkbox",
oninput: move |evt| {
println!("{:?}", evt);
println!("{evt:?}");
},
}
label {
@@ -121,7 +121,7 @@ fn app(cx: Scope) -> Element {
r#type: "{field}",
value: "{value}",
oninput: move |evt: FormEvent| {
println!("{:?}", evt);
println!("{evt:?}");
},
}
label {
+2 -2
View File
@@ -83,7 +83,7 @@ fn app(cx: Scope) -> Element {
div {
class: {
const WORD: &str = "expressions";
format_args!("Arguments can be passed in through curly braces for complex {}", WORD)
format_args!("Arguments can be passed in through curly braces for complex {WORD}")
}
}
}
@@ -214,7 +214,7 @@ fn app(cx: Scope) -> Element {
}
fn format_dollars(dollars: u32, cents: u32) -> String {
format!("${}.{:02}", dollars, cents)
format!("${dollars}.{cents:02}")
}
fn helper<'a>(cx: &'a ScopeState, text: &str) -> Element<'a> {
+1 -1
View File
@@ -27,7 +27,7 @@ fn main() {
let mut file = String::new();
let mut renderer = dioxus_ssr::Renderer::default();
renderer.render_to(&mut file, &vdom).unwrap();
println!("{}", file);
println!("{file}");
}
fn app(cx: Scope) -> Element {
+1 -1
View File
@@ -9,7 +9,7 @@ fn main() {
fn app(cx: Scope) -> Element {
let model = use_state(cx, || String::from("asd"));
println!("{}", model);
println!("{model}");
cx.render(rsx! {
textarea {