Skip to content

Commit

Permalink
Use find() instead of filter().next()
Browse files Browse the repository at this point in the history
  • Loading branch information
OpenByteDev committed Jul 29, 2023
1 parent 33a82db commit 1e39d33
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions dlopen2-derive/src/wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,7 @@ fn field_to_wrapper(field: &Field) -> Option<proc_macro2::TokenStream> {
let segments = &path.segments;
let segment = segments
.iter()
.filter(|segment| segment.ident == "Option")
.next()
.find(|segment| segment.ident == "Option")
.unwrap();
let args = &segment.arguments;
match args {
Expand Down

0 comments on commit 1e39d33

Please sign in to comment.