Make clippy happy

This commit is contained in:
Jonathan Kelley committed 2024-01-10 23:26:26 -08:00
1 parent 593527d58b
commit b8061d6d14
8 files changed
+20 -23

No files matched your search

+1 -1
View File
@@ -868,7 +868,7 @@ where
nodes.extend(self.into_iter().map(|node| node.into_vnode(cx)));
match nodes.into_bump_slice() {
children if children.is_empty() => DynamicNode::default(),
[] => DynamicNode::default(),
children => DynamicNode::Fragment(children),
}
}
+4 -4
View File
@@ -117,7 +117,7 @@ impl ScopeContext {
}
let mut search_parent = self.parent_id;
match with_runtime(|runtime: &crate::runtime::Runtime| {
let cur_runtime = with_runtime(|runtime: &crate::runtime::Runtime| {
while let Some(parent_id) = search_parent {
let parent = runtime.get_context(parent_id).unwrap();
tracing::trace!(
@@ -135,9 +135,9 @@ impl ScopeContext {
search_parent = parent.parent_id;
}
None
})
.flatten()
{
});
match cur_runtime.flatten() {
Some(ctx) => Some(ctx),
None => {
tracing::trace!(
+1 -1
View File
@@ -7,7 +7,7 @@ use dioxus_core::ElementId;
#[test]
fn empty_fragment_creates_nothing() {
fn app(cx: Scope) -> Element {
cx.render(rsx!({ () }))
cx.render(rsx!({}))
}
let mut vdom = VirtualDom::new(app);
+1 -1
View File
@@ -15,7 +15,7 @@ fn test_memory_leak() {
cx.spawn(async {});
if val == 2 || val == 4 {
return render!({ () });
return render!({});
}
let name = cx.use_hook(|| String::from("numbers: "));
+7 -12
View File
@@ -53,20 +53,15 @@ impl Parse for Component {
if content.peek(Token![..]) {
content.parse::<Token![..]>()?;
manual_props = Some(content.parse()?);
} else
//
// Fields
} else if
// Named fields
if content.peek(Ident) && content.peek2(Token![:]) && !content.peek3(Token![:]) {
fields.push(content.parse()?);
} else
//
(content.peek(Ident) && content.peek2(Token![:]) && !content.peek3(Token![:]))
// shorthand struct initialization
// Not a div {}, mod::Component {}, or web-component {}
if content.peek(Ident)
&& !content.peek2(Brace)
&& !content.peek2(Token![:])
&& !content.peek2(Token![-])
// Not a div {}, mod::Component {}, or web-component {}
|| (content.peek(Ident)
&& !content.peek2(Brace)
&& !content.peek2(Token![:])
&& !content.peek2(Token![-]))
{
fields.push(content.parse()?);
} else {
+1 -1
View File
@@ -68,7 +68,7 @@ fn fragments() {
dioxus_ssr::render_lazy(rsx! {
div {
for _ in 0..5 {
{()}
{}
}
}
}),