Apply Clippy lints. (#1863)

* Apply Clippy lints.

* f

* f
This commit is contained in:
Teymour Aldridge 2021-05-21 16:35:30 +01:00 committed by GitHub
parent 246bc5960b
commit 97f67fa77d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 12 deletions

View File

@ -146,13 +146,11 @@ impl ComponentProps {
)}
});
let set_children = if let Some(children) = children_renderer {
let set_children = children_renderer.map(|children| {
Some(quote_spanned! {props_ty.span()=>
.children(#children)
})
} else {
None
};
});
quote_spanned! {props_ty.span()=>
<#props_ty as ::yew::html::Properties>::builder()
@ -163,13 +161,11 @@ impl ComponentProps {
}
Self::With(with_props) => {
let ident = Ident::new("__yew_props", props_ty.span());
let set_children = if let Some(children) = children_renderer {
let set_children = children_renderer.map(|children| {
Some(quote_spanned! {props_ty.span()=>
#ident.children = #children;
})
} else {
None
};
});
let expr = &with_props.expr;
quote! {

View File

@ -65,12 +65,12 @@ impl Parse for PropValue {
}
impl From<PropValue> for Prop {
fn from(prop_value: PropValue) -> Prop {
fn from(val: PropValue) -> Prop {
let PropValue {
label,
colon_token,
value,
} = prop_value;
} = val;
Prop {
label,
question_mark: None,

View File

@ -55,7 +55,7 @@ fn test_get_query_params() {
bar: 69,
};
yew_router::push_route_with_query(Routes::Home, query.clone()).unwrap();
yew_router::push_route_with_query(Routes::Home, query).unwrap();
let params: HashMap<String, String> = parse_query().unwrap();

View File

@ -90,8 +90,8 @@ impl<S: Store> Agent for StoreWrapper<S> {
StoreWrapper {
handlers,
state,
link,
state,
self_dispatcher,
}
}