Skip to content

Commit

Permalink
fix clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
stormshield-gt committed Dec 12, 2024
1 parent 3dab7b3 commit 2dcba70
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
6 changes: 1 addition & 5 deletions rustify_derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,7 @@ fn endpoint_derive(s: synstructure::Structure) -> proc_macro2::TokenStream {

// Find serde attributes
let serde_attrs = parse::attributes(&s.ast().attrs, "serde");
let serde_attrs = if let Ok(v) = serde_attrs {
v
} else {
Vec::<Meta>::new()
};
let serde_attrs = serde_attrs.unwrap_or_default();

// Generate path string
let path = match gen_path(&path) {
Expand Down
8 changes: 3 additions & 5 deletions rustify_derive/src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,9 @@ pub(crate) fn attributes(attrs: &[Attribute], name: &str) -> Result<Vec<Meta>, E
let mut result = Vec::<Meta>::new();
for attr in attrs.iter() {
let meta = attr.parse_meta().map_err(Error::from)?;
match meta.path().is_ident(name) {
true => {
result.push(meta);
}
false => {}

if meta.path().is_ident(name) {
result.push(meta);
}
}

Expand Down

0 comments on commit 2dcba70

Please sign in to comment.