Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Sep 29, 2021
1 parent 977ccea commit fe236a7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions utils/zerovec/src/map/kv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ impl<'a> ZeroMapKV<'a> for str {

#[inline]
fn owned_as_self(o: &Self::OwnedType) -> &Self {
&o
o
}
}

Expand Down Expand Up @@ -150,6 +150,6 @@ impl<'a> ZeroMapKV<'a> for [u8] {

#[inline]
fn owned_as_self(o: &Self::OwnedType) -> &Self {
&o
o
}
}
1 change: 1 addition & 0 deletions utils/zerovec/src/map/serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ where

/// Modified example from https://serde.rs/deserialize-map.html
struct ZeroMapMapVisitor<K: ?Sized, V: ?Sized> {
#[allow(clippy::type_complexity)] // it's a marker type, complexity doesn't matter
marker: PhantomData<fn() -> (Box<K>, Box<V>)>,
}

Expand Down
8 changes: 4 additions & 4 deletions utils/zerovec/src/varzerovec/owned.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,21 +325,21 @@ mod test {
"five".into(),
];
let mut zerovec: VarZeroVecOwned<str> = VarZeroVecOwned::from_elements(&items);
zerovec.insert(1, &"foo3");
zerovec.insert(1, "foo3");
items.insert(1, "foo3".into());
assert_eq!(zerovec, &*items);

items.insert(0, "1234567890".into());
zerovec.insert(0, &"1234567890");
zerovec.insert(0, "1234567890");
assert_eq!(zerovec, &*items);

// make sure inserting at the end works
items.insert(items.len(), "qwertyuiop".into());
zerovec.insert(zerovec.len(), &"qwertyuiop");
zerovec.insert(zerovec.len(), "qwertyuiop");
assert_eq!(zerovec, &*items);

items.insert(0, "asdfghjkl;".into());
zerovec.insert(0, &"asdfghjkl;");
zerovec.insert(0, "asdfghjkl;");
assert_eq!(zerovec, &*items);
}
}

0 comments on commit fe236a7

Please sign in to comment.