|
|
|
|
|
by Manishearth
3336 days ago
|
|
https://github.com/bluss/ordermap is 100% safe rust and pretty fast I believe the stdlib one could be refactored, but I'm not sure. There are a lot of optimizations in that one. IMO "no unsafe code" is a stretch. "no unnecessary unsafe code" is what it should be. |
|
It imports std::collections::hash_map, which has unsafe code, but only for RandomState, which does not. If RandomState were pulled out of hash_map and moved to a crate with no unsafe code, that dependency could be removed and it would be safe crates all the way down.
IMO "no unsafe code" is a stretch. "no unnecessary unsafe code" is what it should be.
The author of the code doesn't get to determine "unnecessary". That should require extensive and hard to get justification.