Skip to content

Commit

Permalink
Apply Clippy lints.
Browse files Browse the repository at this point in the history
  • Loading branch information
teymour-aldridge committed May 21, 2021
1 parent b074b4b commit d7631bf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
12 changes: 4 additions & 8 deletions packages/yew-macro/src/props/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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! {
Expand Down
8 changes: 4 additions & 4 deletions packages/yew-macro/src/props/prop_macro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ impl Parse for PropValue {
}
}

impl Into<Prop> for PropValue {
fn into(self) -> Prop {
let Self {
impl From<PropValue> for Prop {
fn from(val: PropValue) -> Prop {
let PropValue {
label,
colon_token,
value,
} = self;
} = val;
Prop {
label,
question_mark: None,
Expand Down

0 comments on commit d7631bf

Please sign in to comment.