diff options
| author | Crozet Sébastien <developer@crozet.re> | 2021-04-30 11:37:58 +0200 |
|---|---|---|
| committer | Crozet Sébastien <developer@crozet.re> | 2021-04-30 11:37:58 +0200 |
| commit | 2dfbd9ae92c139e306afc87994adac82489f30eb (patch) | |
| tree | c5b9c5e6fcb5561421e2b4b9d99f28e4c83c745e /src/data/arena.rs | |
| parent | ac8ec8e3517c8d9baf8219c04ce907028d70901b (diff) | |
| download | rapier-2dfbd9ae92c139e306afc87994adac82489f30eb.tar.gz rapier-2dfbd9ae92c139e306afc87994adac82489f30eb.tar.bz2 rapier-2dfbd9ae92c139e306afc87994adac82489f30eb.zip | |
Add comments.
Diffstat (limited to 'src/data/arena.rs')
| -rw-r--r-- | src/data/arena.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/data/arena.rs b/src/data/arena.rs index bc7176d..c7cbf07 100644 --- a/src/data/arena.rs +++ b/src/data/arena.rs @@ -770,13 +770,13 @@ impl<T> Arena<T> { /// other kinds of bit-efficient indexing. /// /// You should use the `get` method instead most of the time. - pub fn get_unknown_gen(&self, i: usize) -> Option<(&T, Index)> { - match self.items.get(i) { + pub fn get_unknown_gen(&self, i: u32) -> Option<(&T, Index)> { + match self.items.get(i as usize) { Some(Entry::Occupied { generation, value }) => Some(( value, Index { generation: *generation, - index: i as u32, + index: i, }, )), _ => None, @@ -793,13 +793,13 @@ impl<T> Arena<T> { /// other kinds of bit-efficient indexing. /// /// You should use the `get_mut` method instead most of the time. - pub fn get_unknown_gen_mut(&mut self, i: usize) -> Option<(&mut T, Index)> { - match self.items.get_mut(i) { + pub fn get_unknown_gen_mut(&mut self, i: u32) -> Option<(&mut T, Index)> { + match self.items.get_mut(i as usize) { Some(Entry::Occupied { generation, value }) => Some(( value, Index { generation: *generation, - index: i as u32, + index: i, }, )), _ => None, |
