typed-index-collections
- should be way more popular than it is. It lets you create Vec
s that take custom types instead of usize
as their index so you don't accidentally use the wrong index in the wrong vec.
let user_id = 5;
return processes[user_id]; // Whoops! Should have used typed_index_collections.