diff options
| author | Aleksey Kladov <aleksey.kladov@gmail.com> | 2021-07-18 11:29:22 +0300 |
|---|---|---|
| committer | Aleksey Kladov <aleksey.kladov@gmail.com> | 2021-07-18 11:29:22 +0300 |
| commit | f4de2ece0dd9fbad77f9f99f042e5188eecaaf6a (patch) | |
| tree | a19fa90e23514bbb3657b424ceca403e14d18d6c /lib | |
| parent | 8da560264e82a47811445cd0daa2617e52fddb9d (diff) | |
| download | rust-f4de2ece0dd9fbad77f9f99f042e5188eecaaf6a.tar.gz rust-f4de2ece0dd9fbad77f9f99f042e5188eecaaf6a.zip | |
internal: simplify handling of the build scripts
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/arena/src/map.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/arena/src/map.rs b/lib/arena/src/map.rs index d8acfe0518d..d27f086d37b 100644 --- a/lib/arena/src/map.rs +++ b/lib/arena/src/map.rs @@ -62,6 +62,12 @@ impl<T, V> std::ops::Index<Idx<V>> for ArenaMap<Idx<V>, T> { } } +impl<T, V> std::ops::IndexMut<Idx<V>> for ArenaMap<Idx<V>, T> { + fn index_mut(&mut self, idx: Idx<V>) -> &mut T { + self.v[Self::to_idx(idx)].as_mut().unwrap() + } +} + impl<T, V> Default for ArenaMap<Idx<V>, T> { fn default() -> Self { ArenaMap { v: Vec::new(), _ty: PhantomData } |
