Skip to content

Commit 092e3ce

Browse files
committed
Fix set clippy warnings
1 parent 6da03c5 commit 092e3ce

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/set.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -858,9 +858,9 @@ where
858858
/// [`Eq`]: https://doc.rust-lang.org/std/cmp/trait.Eq.html
859859
/// [`Hash`]: https://doc.rust-lang.org/std/hash/trait.Hash.html
860860
#[cfg_attr(feature = "inline-more", inline)]
861-
pub fn contains<Q: ?Sized>(&self, value: &Q) -> bool
861+
pub fn contains<Q>(&self, value: &Q) -> bool
862862
where
863-
Q: Hash + Equivalent<T>,
863+
Q: Hash + Equivalent<T> + ?Sized,
864864
{
865865
self.map.contains_key(value)
866866
}
@@ -884,9 +884,9 @@ where
884884
/// [`Eq`]: https://doc.rust-lang.org/std/cmp/trait.Eq.html
885885
/// [`Hash`]: https://doc.rust-lang.org/std/hash/trait.Hash.html
886886
#[cfg_attr(feature = "inline-more", inline)]
887-
pub fn get<Q: ?Sized>(&self, value: &Q) -> Option<&T>
887+
pub fn get<Q>(&self, value: &Q) -> Option<&T>
888888
where
889-
Q: Hash + Equivalent<T>,
889+
Q: Hash + Equivalent<T> + ?Sized,
890890
{
891891
// Avoid `Option::map` because it bloats LLVM IR.
892892
match self.map.get_key_value(value) {
@@ -939,9 +939,9 @@ where
939939
/// assert_eq!(set.len(), 4); // a new "fish" was inserted
940940
/// ```
941941
#[inline]
942-
pub fn get_or_insert_owned<Q: ?Sized>(&mut self, value: &Q) -> &T
942+
pub fn get_or_insert_owned<Q>(&mut self, value: &Q) -> &T
943943
where
944-
Q: Hash + Equivalent<T> + ToOwned<Owned = T>,
944+
Q: Hash + Equivalent<T> + ToOwned<Owned = T> + ?Sized,
945945
{
946946
// Although the raw entry gives us `&mut T`, we only return `&T` to be consistent with
947947
// `get`. Key mutation is "raw" because you're not supposed to affect `Eq` or `Hash`.
@@ -971,9 +971,9 @@ where
971971
/// assert_eq!(set.len(), 4); // a new "fish" was inserted
972972
/// ```
973973
#[cfg_attr(feature = "inline-more", inline)]
974-
pub fn get_or_insert_with<Q: ?Sized, F>(&mut self, value: &Q, f: F) -> &T
974+
pub fn get_or_insert_with<Q, F>(&mut self, value: &Q, f: F) -> &T
975975
where
976-
Q: Hash + Equivalent<T>,
976+
Q: Hash + Equivalent<T> + ?Sized,
977977
F: FnOnce(&Q) -> T,
978978
{
979979
// Although the raw entry gives us `&mut T`, we only return `&T` to be consistent with
@@ -1187,9 +1187,9 @@ where
11871187
/// [`Eq`]: https://doc.rust-lang.org/std/cmp/trait.Eq.html
11881188
/// [`Hash`]: https://doc.rust-lang.org/std/hash/trait.Hash.html
11891189
#[cfg_attr(feature = "inline-more", inline)]
1190-
pub fn remove<Q: ?Sized>(&mut self, value: &Q) -> bool
1190+
pub fn remove<Q>(&mut self, value: &Q) -> bool
11911191
where
1192-
Q: Hash + Equivalent<T>,
1192+
Q: Hash + Equivalent<T> + ?Sized,
11931193
{
11941194
self.map.remove(value).is_some()
11951195
}
@@ -1213,9 +1213,9 @@ where
12131213
/// [`Eq`]: https://doc.rust-lang.org/std/cmp/trait.Eq.html
12141214
/// [`Hash`]: https://doc.rust-lang.org/std/hash/trait.Hash.html
12151215
#[cfg_attr(feature = "inline-more", inline)]
1216-
pub fn take<Q: ?Sized>(&mut self, value: &Q) -> Option<T>
1216+
pub fn take<Q>(&mut self, value: &Q) -> Option<T>
12171217
where
1218-
Q: Hash + Equivalent<T>,
1218+
Q: Hash + Equivalent<T> + ?Sized,
12191219
{
12201220
// Avoid `Option::map` because it bloats LLVM IR.
12211221
match self.map.remove_entry(value) {

0 commit comments

Comments
 (0)