Skip to content

Commit dde7ce9

Browse files
JakobDegenfacebook-github-bot
authored andcommitted
enum: Remove an unnecessary field
Reviewed By: IanChilds Differential Revision: D73726003 fbshipit-source-id: 6268f94d42ebf4952221472eb81e2f4c0912a382
1 parent 3c400cd commit dde7ce9

File tree

2 files changed

+0
-14
lines changed

2 files changed

+0
-14
lines changed

starlark/src/values/types/enumeration/enum_type.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ use crate::values::ValueTyped;
6161
use crate::values::enumeration::EnumValue;
6262
use crate::values::enumeration::matcher::EnumTypeMatcher;
6363
use crate::values::enumeration::ty_enum_type::TyEnumData;
64-
use crate::values::enumeration::value::EnumValueGen;
6564
use crate::values::function::FUNCTION_TYPE;
6665
use crate::values::index::convert_index;
6766
use crate::values::list::AllocList;
@@ -340,16 +339,6 @@ where
340339
)?);
341340
Ok(Arc::new(TyEnumData {
342341
name: variable_name.to_owned(),
343-
variants: self
344-
.elements()
345-
.iter()
346-
.map(|(_, enum_value)| {
347-
let enum_value: &EnumValueGen<_> =
348-
EnumValue::from_value(enum_value.to_value())
349-
.expect("known to be enum value");
350-
Ty::of_value(enum_value.value)
351-
})
352-
.collect(),
353342
id: self.id,
354343
ty_enum_value,
355344
ty_enum_type,

starlark/src/values/types/enumeration/ty_enum_type.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ use crate::values::types::type_instance_id::TypeInstanceId;
2525
pub struct TyEnumData {
2626
/// Name of the enum type.
2727
pub(crate) name: String,
28-
/// Types of variants.
29-
pub(crate) variants: Vec<Ty>,
3028
/// Globally unique id of the enum type.
3129
// Id must be last so `Ord` is deterministic.
3230
pub(crate) id: TypeInstanceId,
@@ -48,6 +46,5 @@ impl std::hash::Hash for TyEnumData {
4846
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
4947
// Do not hash `id` because hashing should be deterministic.
5048
self.name.hash(state);
51-
self.variants.hash(state);
5249
}
5350
}

0 commit comments

Comments
 (0)