mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-12-04 01:49:11 +00:00
examples: clippy
This commit is contained in:
parent
4954079212
commit
901bd5b0cd
3 changed files with 4 additions and 4 deletions
|
@ -42,7 +42,7 @@ struct C1Props<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn Child1<'a>(cx: Scope<'a, C1Props<'a>>) -> Element {
|
fn Child1<'a>(cx: Scope<'a, C1Props<'a>>) -> Element {
|
||||||
let (left, right) = cx.props.text.split_once("=").unwrap();
|
let (left, right) = cx.props.text.split_once('=').unwrap();
|
||||||
|
|
||||||
cx.render(rsx! {
|
cx.render(rsx! {
|
||||||
div {
|
div {
|
||||||
|
|
|
@ -146,7 +146,6 @@ fn app(cx: Scope) -> Element {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn calc_val(val: String) -> f64 {
|
fn calc_val(val: String) -> f64 {
|
||||||
let mut result;
|
|
||||||
let mut temp = String::new();
|
let mut temp = String::new();
|
||||||
let mut operation = "+".to_string();
|
let mut operation = "+".to_string();
|
||||||
|
|
||||||
|
@ -169,7 +168,8 @@ fn calc_val(val: String) -> f64 {
|
||||||
temp_value.push(c);
|
temp_value.push(c);
|
||||||
start_index += 1;
|
start_index += 1;
|
||||||
}
|
}
|
||||||
result = temp_value.parse::<f64>().unwrap();
|
|
||||||
|
let mut result = temp_value.parse::<f64>().unwrap();
|
||||||
|
|
||||||
if start_index + 1 >= val.len() {
|
if start_index + 1 >= val.len() {
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -28,7 +28,7 @@ fn app(cx: Scope) -> Element {
|
||||||
}
|
}
|
||||||
main {
|
main {
|
||||||
files.read().path_names.iter().enumerate().map(|(dir_id, path)| {
|
files.read().path_names.iter().enumerate().map(|(dir_id, path)| {
|
||||||
let path_end = path.split('/').last().unwrap_or_else(|| path.as_str());
|
let path_end = path.split('/').last().unwrap_or(path.as_str());
|
||||||
let icon_type = if path_end.contains('.') {
|
let icon_type = if path_end.contains('.') {
|
||||||
"description"
|
"description"
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue