Skip to content

Commit

Permalink
Remove ImageError::UnsupportedError()
Browse files Browse the repository at this point in the history
Ref: #1134
  • Loading branch information
nabijaczleweli committed Apr 19, 2020
1 parent 947fda9 commit 1bf78ba
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,15 +191,6 @@ pub enum ImageFormatHint {
__NonExhaustive(NonExhaustiveMarker),
}

// Internal implementation block for ImageError.
#[allow(non_upper_case_globals)]
#[allow(non_snake_case)]
impl ImageError {
pub(crate) fn UnsupportedError(message: String) -> Self {
ImageError::Unsupported(UnsupportedError::legacy_from_string(message))
}
}

impl UnsupportedError {
/// Create an `UnsupportedError` for an image with details on the unsupported feature.
///
Expand All @@ -212,14 +203,6 @@ impl UnsupportedError {
}
}

/// A shorthand for a generic feature without an image format.
pub(crate) fn legacy_from_string(message: String) -> Self {
UnsupportedError {
format: ImageFormatHint::Unknown,
kind: UnsupportedErrorKind::GenericFeature(message),
}
}

/// Returns the corresponding `UnsupportedErrorKind` of the error.
pub fn kind(&self) -> UnsupportedErrorKind {
self.kind.clone()
Expand Down

0 comments on commit 1bf78ba

Please sign in to comment.