Skip to content

Commit

Permalink
fix clippy warning
Browse files Browse the repository at this point in the history
  • Loading branch information
sam0x17 committed Aug 9, 2024
1 parent 7aa4dc8 commit 320aecf
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions support/linting/src/require_freeze_struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,10 @@ mod tests {
let item_struct: ItemStruct = syn::parse_str(input).expect("should only use on a struct");
let mut visitor = EncodeDecodeVisitor::default();
visitor.visit_item_struct(&item_struct);
if visitor.errors.is_empty() {
Ok(())
} else {
Err(visitor.errors[0].clone())
if let Some(error) = visitor.errors.first() {
return Err(error.clone());
}
Ok(())
}

#[test]
Expand Down

0 comments on commit 320aecf

Please sign in to comment.