Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. use std::io;
  2.  
  3. #[derive(Debug)]
  4. pub enum IoError {
  5. AddressNotFound,
  6. AddressesOverlapError,
  7. IoPluginNotFoundError,
  8. TooManyFilesError,
  9. Parse(io::Error),
  10. }
  11.  
  12. impl PartialEq for IoError {
  13. fn eq(&self, rhs: &IoError) -> bool {
  14. match self {
  15. IoError::AddressNotFound => if let IoError::AddressNotFound = rhs { true } else { false },
  16. IoError::AddressesOverlapError => if let IoError::AddressesOverlapError = rhs { true } else { false },
  17. IoError::IoPluginNotFoundError => if let IoError::IoPluginNotFoundError = rhs { true } else { false },
  18. IoError::TooManyFilesError => if let IoError::TooManyFilesError = rhs { true } else { false },
  19. IoError::Parse(_) => if let IoError::Parse(_) = rhs { true } else { false },
  20. }
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement