Skip to content

Commit

Permalink
Fix an uncoming Clippy lint
Browse files Browse the repository at this point in the history
This lint isn't an issue on our pinned nightly, but it is on more
recent nightlies as of this writing. Might as well fix it now.
  • Loading branch information
joshlf committed Aug 16, 2023
1 parent 2a406e8 commit 8fadf10
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion zerocopy-derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// our MSRV.
#![allow(unknown_lints)]
#![deny(renamed_and_removed_lints)]
#![deny(clippy::all, clippy::missing_safety_doc)]
#![deny(clippy::all, clippy::missing_safety_doc, clippy::undocumented_unsafe_blocks)]
#![deny(
rustdoc::bare_urls,
rustdoc::broken_intra_doc_links,
Expand Down
5 changes: 2 additions & 3 deletions zerocopy-derive/src/repr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,8 @@ impl<R: KindRepr> Config<R> {
}

let initial_sp = metas[0].span();
let err_span = metas.iter().skip(1).fold(Some(initial_sp), |sp_option, meta| {
sp_option.and_then(|sp| sp.join(meta.span()))
});
let err_span = metas.iter().skip(1).try_fold(initial_sp, |sp, meta| sp.join(meta.span()));


if self.allowed_combinations.contains(&reprs.as_slice()) {
Ok(reprs)
Expand Down

0 comments on commit 8fadf10

Please sign in to comment.