Removed unused functions and make InvalidChunkIndex a UsageError
This commit is contained in:
1 parent
8c0c13f022
commit
e1f4161e0b
5 files changed
+21
-95
No files matched your search
+8
-2
@@ -56,7 +56,6 @@ pub enum TiffFormatError {
|
||||
actual_samples: usize,
|
||||
required_samples: usize,
|
||||
},
|
||||
InvalidChunkIndex(usize),
|
||||
InvalidTag,
|
||||
InvalidTagValueType(Tag),
|
||||
RequiredTagNotFound(Tag),
|
||||
@@ -101,7 +100,6 @@ impl fmt::Display for TiffFormatError {
|
||||
actual_samples, required_samples
|
||||
)
|
||||
}
|
||||
InvalidChunkIndex(index) => write!(fmt, "Image chunk index ({}) requested.", index),
|
||||
InvalidTag => write!(fmt, "Image contains invalid tag."),
|
||||
InvalidTagValueType(ref tag) => {
|
||||
write!(fmt, "Tag `{:?}` did not have the expected value type.", tag)
|
||||
@@ -207,6 +205,7 @@ impl fmt::Display for TiffUnsupportedError {
|
||||
#[derive(Debug)]
|
||||
pub enum UsageError {
|
||||
InvalidChunkType(ChunkType, ChunkType),
|
||||
InvalidChunkIndex(usize),
|
||||
}
|
||||
|
||||
impl fmt::Display for UsageError {
|
||||
@@ -220,6 +219,7 @@ impl fmt::Display for UsageError {
|
||||
expected, actual
|
||||
)
|
||||
}
|
||||
InvalidChunkIndex(index) => write!(fmt, "Image chunk index ({}) requested.", index),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -292,6 +292,12 @@ impl From<TiffUnsupportedError> for TiffError {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<UsageError> for TiffError {
|
||||
fn from(err: UsageError) -> TiffError {
|
||||
TiffError::UsageError(err)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<std::num::TryFromIntError> for TiffError {
|
||||
fn from(_err: std::num::TryFromIntError) -> TiffError {
|
||||
TiffError::IntSizeError
|
||||
|
||||
Reference in new issue
Block a user