Skip to content

Commit 8e2acea

Browse files
committed
Enable cloning of UnsupportedFeature to allow use in image-tiff crate
1 parent beb46c0 commit 8e2acea

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/error.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use alloc::boxed::Box;
2-
use alloc::string::String;
32
use alloc::fmt;
3+
use alloc::string::String;
44
use core::result;
55
use std::error::Error as StdError;
66
use std::io::Error as IoError;
@@ -10,7 +10,7 @@ pub type Result<T> = result::Result<T, Error>;
1010
/// An enumeration over JPEG features (currently) unsupported by this library.
1111
///
1212
/// Support for features listed here may be included in future versions of this library.
13-
#[derive(Debug)]
13+
#[derive(Debug, Clone)]
1414
pub enum UnsupportedFeature {
1515
/// Hierarchical JPEG.
1616
Hierarchical,
@@ -46,10 +46,10 @@ pub enum Error {
4646
impl fmt::Display for Error {
4747
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
4848
match *self {
49-
Error::Format(ref desc) => write!(f, "invalid JPEG format: {}", desc),
49+
Error::Format(ref desc) => write!(f, "invalid JPEG format: {}", desc),
5050
Error::Unsupported(ref feat) => write!(f, "unsupported JPEG feature: {:?}", feat),
51-
Error::Io(ref err) => err.fmt(f),
52-
Error::Internal(ref err) => err.fmt(f),
51+
Error::Io(ref err) => err.fmt(f),
52+
Error::Internal(ref err) => err.fmt(f),
5353
}
5454
}
5555
}

0 commit comments

Comments
 (0)