2
0
Fork 0
mirror of https://github.com/DioxusLabs/dioxus synced 2025-02-24 11:27:12 +00:00

fix clippy

This commit is contained in:
Evan Almloff 2023-08-09 11:10:41 -07:00
parent 8b4e0b3e07
commit 8d1c17ba7d
6 changed files with 12 additions and 14 deletions
packages
cli/src
core/tests
desktop/src
html/src
native-core/src
rsx/src

View file

@ -126,7 +126,7 @@ impl Default for DioxusConfig {
},
bundle: BundleConfig {
identifier: Some(format!("io.github.{name}")),
publisher: Some(name.into()),
publisher: Some(name),
..Default::default()
},
plugin: toml::Value::Table(toml::map::Map::new()),

View file

@ -36,7 +36,7 @@ fn suspended_child(cx: Scope) -> Element {
cx.spawn(async move {
val += 1;
});
return cx.suspend()?;
cx.suspend()?;
}
render!("child")

View file

@ -158,8 +158,13 @@ fn get_mime_from_path(trimmed: &Path) -> Result<&'static str> {
}
let res = match infer::get_from_path(trimmed)?.map(|f| f.mime_type()) {
Some(t) if t == "text/plain" => get_mime_by_ext(trimmed),
Some(f) => f,
Some(f) => {
if f == "text/plain" {
get_mime_by_ext(trimmed)
} else {
f
}
}
None => get_mime_by_ext(trimmed),
};

View file

@ -42,7 +42,7 @@ pub fn use_eval(cx: &ScopeState) -> &EvalCreator {
Rc::new(move |script: &str| {
eval_provider
.new_evaluator(script.to_string())
.map(|evaluator| UseEval::new(evaluator))
.map(UseEval::new)
}) as Rc<dyn Fn(&str) -> Result<UseEval, EvalError>>
})
}

View file

@ -446,7 +446,6 @@ impl<V: FromAnyValue + Send + Sync> RealDom<V> {
drop(tree);
children.reverse();
if let Some(node) = self.get_mut(id) {
let node = node;
f(node);
stack.extend(children.iter());
}

View file

@ -288,10 +288,7 @@ impl DynamicMapping {
let idx = self.last_attribute_idx;
self.last_attribute_idx += 1;
self.attribute_to_idx
.entry(attr)
.or_insert_with(Vec::new)
.push(idx);
self.attribute_to_idx.entry(attr).or_default().push(idx);
idx
}
@ -300,10 +297,7 @@ impl DynamicMapping {
let idx = self.last_element_idx;
self.last_element_idx += 1;
self.node_to_idx
.entry(node)
.or_insert_with(Vec::new)
.push(idx);
self.node_to_idx.entry(node).or_default().push(idx);
idx
}