Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
idanarye committed Aug 26, 2023
1 parent 08a5a26 commit e15bd2e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions typed-builder-macro/src/field_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,11 +305,11 @@ impl SetterSettings {
Ok(())
}
"prefix" => {
self.prefix = Some(expr_to_lit_string(&*assign.right)?);
self.prefix = Some(expr_to_lit_string(&assign.right)?);
Ok(())
}
"suffix" => {
self.suffix = Some(expr_to_lit_string(&*assign.right)?);
self.suffix = Some(expr_to_lit_string(&assign.right)?);
Ok(())
}
_ => Err(Error::new_spanned(&assign, format!("Unknown parameter {:?}", name))),
Expand Down
4 changes: 2 additions & 2 deletions typed-builder-macro/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ pub fn expr_to_lit_string(expr: &syn::Expr) -> Result<String, Error> {
match expr {
syn::Expr::Lit(lit) => match &lit.lit {
syn::Lit::Str(str) => Ok(str.value()),
_ => return Err(Error::new_spanned(expr, "attribute only allows str values")),
_ => Err(Error::new_spanned(expr, "attribute only allows str values")),
},
_ => return Err(Error::new_spanned(expr, "attribute only allows str values")),
_ => Err(Error::new_spanned(expr, "attribute only allows str values")),
}
}

0 comments on commit e15bd2e

Please sign in to comment.