diff options
| author | Igor Tolmachev <me@igorek.dev> | 2024-07-16 20:08:01 +0900 |
|---|---|---|
| committer | Igor Tolmachev <me@igorek.dev> | 2024-07-16 20:08:01 +0900 |
| commit | 9c0e544e79a4f7874dab449674a11d899bf61963 (patch) | |
| tree | 89ce5177ede27b3966f9589e012887e8614a7b38 /src/error.rs | |
| parent | cc18a545a87ca616f05114d174690e5cc9614669 (diff) | |
| download | archivator-9c0e544e79a4f7874dab449674a11d899bf61963.tar.gz archivator-9c0e544e79a4f7874dab449674a11d899bf61963.zip | |
Add tests and fix bugs
Diffstat (limited to 'src/error.rs')
| -rw-r--r-- | src/error.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/error.rs b/src/error.rs index 97a4e62..518b0e9 100644 --- a/src/error.rs +++ b/src/error.rs | |||
| @@ -17,6 +17,15 @@ impl<E: Error> From<io::Error> for ArchiveError<E> { | |||
| 17 | } | 17 | } |
| 18 | } | 18 | } |
| 19 | 19 | ||
| 20 | impl<E: Error + PartialEq> PartialEq<E> for ArchiveError<E> { | ||
| 21 | fn eq(&self, other: &E) -> bool { | ||
| 22 | match self { | ||
| 23 | Self::Archivator { error, .. } => error == other, | ||
| 24 | _ => false, | ||
| 25 | } | ||
| 26 | } | ||
| 27 | } | ||
| 28 | |||
| 20 | impl<E: Error> Display for ArchiveError<E> { | 29 | impl<E: Error> Display for ArchiveError<E> { |
| 21 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 30 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
| 22 | match self { | 31 | match self { |
