diff options
Diffstat (limited to 'lib/entry/libimagentryannotation')
-rw-r--r-- | lib/entry/libimagentryannotation/src/annotateable.rs | 4 | ||||
-rw-r--r-- | lib/entry/libimagentryannotation/src/annotation_fetcher.rs | 4 | ||||
-rw-r--r-- | lib/entry/libimagentryannotation/src/error.rs | 15 |
3 files changed, 4 insertions, 19 deletions
diff --git a/lib/entry/libimagentryannotation/src/annotateable.rs b/lib/entry/libimagentryannotation/src/annotateable.rs index 85f5f89a..b356753e 100644 --- a/lib/entry/libimagentryannotation/src/annotateable.rs +++ b/lib/entry/libimagentryannotation/src/annotateable.rs @@ -25,13 +25,13 @@ use libimagstore::store::Entry; use libimagstore::store::FileLockEntry; use libimagstore::store::Store; use libimagentrylink::internal::InternalLinker; -use libimagerror::into::IntoError; use toml_query::read::TomlValueReadExt; use toml_query::insert::TomlValueInsertExt; use result::Result; use error::AnnotationErrorKind as AEK; +use error::AnnotationError as AE; use error::ResultExt; pub trait Annotateable { @@ -72,7 +72,7 @@ impl Annotateable for Entry { .and_then(|res| match res { Some(&Value::Boolean(b)) => Ok(b), None => Ok(false), - _ => Err(AEK::HeaderTypeError.into_error()), + _ => Err(AE::from_kind(AEK::HeaderTypeError)), }) } diff --git a/lib/entry/libimagentryannotation/src/annotation_fetcher.rs b/lib/entry/libimagentryannotation/src/annotation_fetcher.rs index c49ce865..27f2f4b8 100644 --- a/lib/entry/libimagentryannotation/src/annotation_fetcher.rs +++ b/lib/entry/libimagentryannotation/src/annotation_fetcher.rs @@ -70,12 +70,12 @@ pub mod iter { use toml_query::read::TomlValueReadExt; - use libimagerror::into::IntoError; use libimagnotes::note::Note; use libimagnotes::note::NoteIterator; use result::Result; use error::AnnotationErrorKind as AEK; + use error::AnnotationError as AE; use error::ResultExt; #[derive(Debug)] @@ -99,7 +99,7 @@ pub mod iter { match note.get_header().read("annotation.is_annotation") { Ok(None) => continue, // not an annotation Ok(Some(&Value::Boolean(true))) => return Some(Ok(note)), - Ok(Some(_)) => return Some(Err(AEK::HeaderTypeError.into_error())), + Ok(Some(_)) => return Some(Err(AE::from_kind(AEK::HeaderTypeError))), Err(e) => return Some(Err(e).chain_err(|| AEK::HeaderReadError)), } }, diff --git a/lib/entry/libimagentryannotation/src/error.rs b/lib/entry/libimagentryannotation/src/error.rs index 7543b85a..8a349b71 100644 --- a/lib/entry/libimagentryannotation/src/error.rs +++ b/lib/entry/libimagentryannotation/src/error.rs @@ -17,10 +17,6 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // -use std::error::Error; - -use libimagerror::into::IntoError; - error_chain! { types { AnnotationError, AnnotationErrorKind, ResultExt, Result; @@ -60,14 +56,3 @@ error_chain! { } } -impl IntoError for AnnotationErrorKind { - type Target = AnnotationError; - - fn into_error(self) -> Self::Target { - AnnotationError::from_kind(self) - } - - fn into_error_with_cause(self, _: Box<Error>) -> Self::Target { - AnnotationError::from_kind(self) - } -} |