Skip to content

Commit 35de61a

Browse files
stepanchegfacebook-github-bot
authored andcommitted
Unimpl Eq for VecMap
Summary: Map comparison is trick (ordered vs unordered), so remove this unused implementations to avoid using them accidentally. Reviewed By: ndmitchell Differential Revision: D41166332 fbshipit-source-id: aee935e98d5ec13aa2910bee83ebaa1b07faff1d
1 parent c5c9a38 commit 35de61a

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

starlark_map/src/vec2/mod.rs

-8
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,6 @@ pub(crate) struct Vec2<K, V> {
8383
unsafe impl<K: Send, V: Send> Send for Vec2<K, V> {}
8484
unsafe impl<K: Sync, V: Sync> Sync for Vec2<K, V> {}
8585

86-
impl<K: PartialEq, V: PartialEq> PartialEq for Vec2<K, V> {
87-
fn eq(&self, other: &Self) -> bool {
88-
self.len == other.len && self.iter().eq(other.iter())
89-
}
90-
}
91-
92-
impl<K: Eq, V: Eq> Eq for Vec2<K, V> {}
93-
9486
impl<K, V> Default for Vec2<K, V> {
9587
#[inline]
9688
fn default() -> Vec2<K, V> {

starlark_map/src/vec_map/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ impl<K: Hash, V: Hash> Hash for Bucket<K, V> {
5555
}
5656
}
5757

58-
#[derive(Debug, Clone, Eq, PartialEq, Default_, Allocative)]
58+
#[derive(Debug, Clone, Default_, Allocative)]
5959
pub(crate) struct VecMap<K, V> {
6060
buckets: Vec2<(K, V), StarlarkHashValue>,
6161
}

0 commit comments

Comments
 (0)