Skip to content

Commit

Permalink
Use clone_from to fix clippy violation
Browse files Browse the repository at this point in the history
  • Loading branch information
TedDriggs committed May 13, 2024
1 parent 78f3d11 commit bb36185
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions core/src/options/from_derive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ impl ParseData for FdiOptions {
fn parse_field(&mut self, field: &syn::Field) -> Result<()> {
match field.ident.as_ref().map(|v| v.to_string()).as_deref() {
Some("vis") => {
self.vis = field.ident.clone();
self.vis.clone_from(&field.ident);
Ok(())
}
Some("data") => {
self.data = field.ident.clone();
self.data.clone_from(&field.ident);
Ok(())
}
Some("generics") => {
self.generics = field.ident.clone();
self.generics.clone_from(&field.ident);
Ok(())
}
_ => self.base.parse_field(field),
Expand Down
4 changes: 2 additions & 2 deletions core/src/options/from_field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ impl ParseData for FromFieldOptions {
fn parse_field(&mut self, field: &syn::Field) -> Result<()> {
match field.ident.as_ref().map(|v| v.to_string()).as_deref() {
Some("vis") => {
self.vis = field.ident.clone();
self.vis.clone_from(&field.ident);
Ok(())
}
Some("ty") => {
self.ty = field.ident.clone();
self.ty.clone_from(&field.ident);
Ok(())
}
_ => self.base.parse_field(field),
Expand Down
4 changes: 2 additions & 2 deletions core/src/options/from_type_param.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ impl ParseData for FromTypeParamOptions {
fn parse_field(&mut self, field: &syn::Field) -> Result<()> {
match field.ident.as_ref().map(|v| v.to_string()).as_deref() {
Some("bounds") => {
self.bounds = field.ident.clone();
self.bounds.clone_from(&field.ident);
Ok(())
}
Some("default") => {
self.default = field.ident.clone();
self.default.clone_from(&field.ident);
Ok(())
}
_ => self.base.parse_field(field),
Expand Down
4 changes: 2 additions & 2 deletions core/src/options/from_variant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ impl ParseData for FromVariantOptions {
fn parse_field(&mut self, field: &Field) -> Result<()> {
match field.ident.as_ref().map(|v| v.to_string()).as_deref() {
Some("discriminant") => {
self.discriminant = field.ident.clone();
self.discriminant.clone_from(&field.ident);
Ok(())
}
Some("fields") => {
self.fields = field.ident.clone();
self.fields.clone_from(&field.ident);
Ok(())
}
_ => self.base.parse_field(field),
Expand Down
2 changes: 1 addition & 1 deletion core/src/options/outer_from.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ impl ParseData for OuterFrom {
fn parse_field(&mut self, field: &Field) -> Result<()> {
match field.ident.as_ref().map(|v| v.to_string()).as_deref() {
Some("ident") => {
self.ident = field.ident.clone();
self.ident.clone_from(&field.ident);
Ok(())
}
Some("attrs") => {
Expand Down

0 comments on commit bb36185

Please sign in to comment.