Skip to content

Commit

Permalink
Make clippy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
rozbb committed Nov 1, 2023
1 parent cbc7738 commit 9898435
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hybrid-array/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -583,13 +583,13 @@ pub trait ArrayExt<T>: Sized {
F: FnMut(usize) -> Result<T, E>;

/// Create array using the given callback function for each element.
#[allow(clippy::unwrap_used)]
#[allow(clippy::unwrap_used, unused_qualifications)]
fn from_fn<F>(mut cb: F) -> Self
where
F: FnMut(usize) -> T,
{
// Turn the ordinary callback into a Result callback that always returns Ok
let wrapped_cb = |idx| Result::<_, ::core::convert::Infallible>::Ok(cb(idx));
let wrapped_cb = |idx| Result::<T, ::core::convert::Infallible>::Ok(cb(idx));
// Now use the try_from version of this method
Self::try_from_fn(wrapped_cb).unwrap()
}
Expand Down

0 comments on commit 9898435

Please sign in to comment.