rust-vmm / vm-memory

Virtual machine's guest memory crate
Apache License 2.0
305 stars 98 forks source link

Implement PartialEq for errors in vm-memory #194

Open andreeaflorescu opened 2 years ago

andreeaflorescu commented 2 years ago

The lack of PartialEq in vm-memory is forcing weird patterns across all rust-vmm crates (where errors need to be compared using match or even worse where errors are not compared at all). The problem with implementing PartialEq resides in the underlying io::Error which does not implement PartialEq. Since the use case for errors is pretty well defined in vm-memory, we should be able to manually implement PartialEq because we can reason about what errors should actually be equal.