Skip to content

Commit

Permalink
fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelcolvin committed Sep 9, 2024
1 parent 9c67b85 commit 1534be3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion crates/fuzz/fuzz_targets/compare_to_serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub fn values_equal(jiter_value: &JiterValue, serde_value: &SerdeValue) -> bool
if o1.len() != o2.len() {
return false;
}
for (k1, v1) in o1.iter_unique() {
for (k1, v1) in o1.iter() {
if let Some(v2) = o2.get::<str>(k1.as_ref()) {
if !values_equal(v1, v2) {
return false;
Expand Down
17 changes: 9 additions & 8 deletions crates/jiter/src/lazy_index_map.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
use std::borrow::{Borrow, Cow};
use std::cell::Cell;
use std::fmt;
use std::hash::{DefaultHasher, Hash, Hasher};
use std::mem::MaybeUninit;
use std::hash::Hash;
use std::slice::Iter as SliceIter;
use std::sync::atomic::{AtomicU16, AtomicUsize, Ordering};
use std::sync::atomic::AtomicU16;

use ahash::RandomState;
use bitvec::order::Lsb0;
use indexmap::IndexMap;

/// Like [IndexMap](https://docs.rs/indexmap/latest/indexmap/) but only builds the lookup map when it's needed.
Expand Down Expand Up @@ -144,9 +141,13 @@ where
}

mod index_map_vec {
use std::sync::atomic::AtomicU16;
use bitvec::order::Lsb0;
use std::borrow::{Borrow, Cow};
use std::hash::{DefaultHasher, Hash, Hasher};
use std::mem::MaybeUninit;
use std::sync::atomic::{AtomicU16, AtomicUsize, Ordering};

use super::*;
use super::HASHMAP_THRESHOLD;

pub(super) struct LazyIndexMapArray<K, V> {
data: Box<[MaybeUninit<(K, V)>; HASHMAP_THRESHOLD]>,
Expand Down Expand Up @@ -334,7 +335,7 @@ impl<'a, K, V> Iterator for LazyIndexMapIter<'a, K, V> {
fn next(&mut self) -> Option<Self::Item> {
match self {
LazyIndexMapIter::Vec { iter, mask } => {
while let Some((k, v)) = iter.next() {
for (k, v) in iter.by_ref() {
let is_not_duplicate = mask.next().expect("mask covers array length");
if is_not_duplicate {
return Some((k, v));
Expand Down

0 comments on commit 1534be3

Please sign in to comment.