Trait EnumMapGet

Source
pub trait EnumMapGet<K, V> {
    // Required methods
    fn get(&self, key: K) -> &V;
    fn get_mut(&mut self, key: K) -> &mut V;
}
Expand description

This is a workaround for clippy index warnings for safe index ops. It also is more convenient in some cases to use these fundtions if you want to make sure something is &mut, or &

Required Methods§

Source

fn get(&self, key: K) -> &V

Gets a normal reference to the value

Source

fn get_mut(&mut self, key: K) -> &mut V

Gets a mutable reference to the value

Implementations on Foreign Types§

Source§

impl<K: Enum + EnumArray<V>, V> EnumMapGet<K, V> for EnumMap<K, V>

Source§

fn get(&self, key: K) -> &V

Source§

fn get_mut(&mut self, key: K) -> &mut V

Implementors§