cairo-native 0.9.0-rc.7

A compiler to convert Cairo's IR Sierra code to MLIR and execute it.
use cairo_lang_sierra::ids::ConcreteTypeId;
use std::collections::HashMap;

// Maps a Snapshot<Enum> type to its enum variant types

#[derive(Default)]
pub struct EnumSnapshotVariantsMeta {
    map: HashMap<ConcreteTypeId, Vec<ConcreteTypeId>>,
}

impl EnumSnapshotVariantsMeta {
    pub fn set_mapping(&mut self, snapshot_id: &ConcreteTypeId, variants: &[ConcreteTypeId]) {
        self.map.insert(snapshot_id.clone(), variants.to_vec());
    }

    pub fn get_variants(&self, snapshot_id: &ConcreteTypeId) -> Option<&Vec<ConcreteTypeId>> {
        self.map.get(snapshot_id)
    }
}