Skip to content

Commit 5b262ee

Browse files
committed
Fix pedantic clippy lints in fieldvec
- Matching with Unit explicitly instead of `_` outlines the fact that the pattern contains no data. - For loop implicitly creates the iterator on the reference, which is more concise.
1 parent 510b0c4 commit 5b262ee

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/primitives/fieldvec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ impl<F: Clone + Default> iter::FromIterator<F> for FieldVec<F> {
352352
// This goofy map construction is needed because we cannot use the
353353
// `[F::default(); N]` syntax without adding a `Copy` bound to `F`.
354354
// After Rust 1.63 we will be able to use array::from_fn.
355-
let mut inner_a = [(); NO_ALLOC_MAX_LENGTH].map(|_| F::default());
355+
let mut inner_a = [(); NO_ALLOC_MAX_LENGTH].map(|()| F::default());
356356
let mut len = 0;
357357
for elem in iter.by_ref().take(NO_ALLOC_MAX_LENGTH) {
358358
inner_a[len] = elem;
@@ -389,7 +389,7 @@ impl<F: Clone + Default> iter::FromIterator<F> for FieldVec<F> {
389389

390390
impl<F: fmt::Display> fmt::Display for FieldVec<F> {
391391
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
392-
for fe in self.iter() {
392+
for fe in self {
393393
fe.fmt(f)?;
394394
}
395395
Ok(())

0 commit comments

Comments
 (0)