From 7b3841f2028468fc59927866dba03d89e9c745a2 Mon Sep 17 00:00:00 2001 From: Stiopa Koltsov Date: Wed, 9 Nov 2022 18:19:04 -0800 Subject: [PATCH] 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 --- starlark-rust/starlark_map/src/vec2/mod.rs | 8 -------- starlark-rust/starlark_map/src/vec_map/mod.rs | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/starlark-rust/starlark_map/src/vec2/mod.rs b/starlark-rust/starlark_map/src/vec2/mod.rs index 0ee39eeaa1de2..9f116a386659f 100644 --- a/starlark-rust/starlark_map/src/vec2/mod.rs +++ b/starlark-rust/starlark_map/src/vec2/mod.rs @@ -83,14 +83,6 @@ pub(crate) struct Vec2 { unsafe impl Send for Vec2 {} unsafe impl Sync for Vec2 {} -impl PartialEq for Vec2 { - fn eq(&self, other: &Self) -> bool { - self.len == other.len && self.iter().eq(other.iter()) - } -} - -impl Eq for Vec2 {} - impl Default for Vec2 { #[inline] fn default() -> Vec2 { diff --git a/starlark-rust/starlark_map/src/vec_map/mod.rs b/starlark-rust/starlark_map/src/vec_map/mod.rs index 0dc8a5cf62e5e..05694fe888ca9 100644 --- a/starlark-rust/starlark_map/src/vec_map/mod.rs +++ b/starlark-rust/starlark_map/src/vec_map/mod.rs @@ -55,7 +55,7 @@ impl Hash for Bucket { } } -#[derive(Debug, Clone, Eq, PartialEq, Default_, Allocative)] +#[derive(Debug, Clone, Default_, Allocative)] pub(crate) struct VecMap { buckets: Vec2<(K, V), StarlarkHashValue>, }