diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2017-09-04 10:54:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-04 10:54:56 +0200 |
commit | 13af22ac16717235043de25b67194992c0c3a846 (patch) | |
tree | fd7f5082b90d74693c470131c09ab192a07149d8 | |
parent | e9ed4dfcab399b9af5b53b85f41476fb9cc21df5 (diff) | |
parent | 18e806f588a2917ba21d289e93216edd3d6c801e (diff) |
Merge pull request #1049 from matthiasbeyer/use-error-chain-result-type
Remove dedicated result modules, use error chain generated Result types
84 files changed, 52 insertions, 546 deletions
diff --git a/bin/domain/imag-diary/src/create.rs b/bin/domain/imag-diary/src/create.rs index e49cae25..3d66599b 100644 --- a/bin/domain/imag-diary/src/create.rs +++ b/bin/domain/imag-diary/src/create.rs @@ -27,7 +27,7 @@ use libimagentryedit::edit::Edit; use libimagrt::runtime::Runtime; use libimagerror::trace::trace_error; use libimagdiary::entry::Entry; -use libimagdiary::result::Result; +use libimagdiary::error::Result; use libimagutil::warn_exit::warn_exit; use util::get_diary_name; diff --git a/lib/domain/libimagbookmark/src/collection.rs b/lib/domain/libimagbookmark/src/collection.rs index 525500ff..858460d0 100644 --- a/lib/domain/libimagbookmark/src/collection.rs +++ b/lib/domain/libimagbookmark/src/collection.rs @@ -31,7 +31,7 @@ use regex::Regex; use error::BookmarkErrorKind as BEK; use error::BookmarkError as BE; use error::ResultExt; -use result::Result; +use error::Result; use module_path::ModuleEntryPath; use libimagstore::store::Store; @@ -150,7 +150,7 @@ impl<'a> BookmarkCollection<'a> { pub mod iter { use link::Link; - use result::Result; + use error::Result; use error::{ResultExt, BookmarkErrorKind as BEK}; pub struct LinkIter<I>(I) diff --git a/lib/domain/libimagbookmark/src/lib.rs b/lib/domain/libimagbookmark/src/lib.rs index 00d94f61..6567cbf1 100644 --- a/lib/domain/libimagbookmark/src/lib.rs +++ b/lib/domain/libimagbookmark/src/lib.rs @@ -48,4 +48,3 @@ module_entry_path_mod!("bookmark"); pub mod collection; pub mod error; pub mod link; -pub mod result; diff --git a/lib/domain/libimagbookmark/src/link.rs b/lib/domain/libimagbookmark/src/link.rs index acc68e60..038fea7f 100644 --- a/lib/domain/libimagbookmark/src/link.rs +++ b/lib/domain/libimagbookmark/src/link.rs @@ -19,7 +19,7 @@ use std::ops::{Deref, DerefMut}; -use result::Result; +use error::Result; use url::Url; diff --git a/lib/domain/libimagbookmark/src/result.rs b/lib/domain/libimagbookmark/src/result.rs deleted file mode 100644 index 780a8035..00000000 --- a/lib/domain/libimagbookmark/src/result.rs +++ /dev/null @@ -1,25 +0,0 @@ -// -// imag - the personal information management suite for the commandline -// Copyright (C) 2015, 2016 Matthias Beyer <mail@beyermatthias.de> and contributors -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; version -// 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -// - -use std::result::Result as RResult; - -use error::BookmarkError; - -pub type Result<T> = RResult<T, BookmarkError>; - diff --git a/lib/domain/libimagcounter/src/counter.rs b/lib/domain/libimagcounter/src/counter.rs index f58e5bb5..855ee5a1 100644 --- a/lib/domain/libimagcounter/src/counter.rs +++ b/lib/domain/libimagcounter/src/counter.rs @@ -34,7 +34,7 @@ use libimagstore::storeid::StoreId; use libimagstore::storeid::IntoStoreId; use module_path::ModuleEntryPath; -use result::Result; +use error::Result; use error::CounterError as CE; use error::CounterErrorKind as CEK; use error::ResultExt; diff --git a/lib/domain/libimagcounter/src/lib.rs b/lib/domain/libimagcounter/src/lib.rs index 6aa28b71..41db759d 100644 --- a/lib/domain/libimagcounter/src/lib.rs +++ b/lib/domain/libimagcounter/src/lib.rs @@ -47,5 +47,4 @@ module_entry_path_mod!("counter"); pub mod counter; pub mod error; -pub mod result; diff --git a/lib/domain/libimagcounter/src/result.rs b/lib/domain/libimagcounter/src/result.rs deleted file mode 100644 index e24b90c9..00000000 --- a/lib/domain/libimagcounter/src/result.rs +++ /dev/null @@ -1,25 +0,0 @@ -// -// imag - the personal information management suite for the commandline -// Copyright (C) 2015, 2016 Matthias Beyer <mail@beyermatthias.de> and contributors -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; version -// 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -// - -use std::result::Result as RResult; - -use error::CounterError; - -pub type Result<T> = RResult<T, CounterError>; - diff --git a/lib/domain/libimagdiary/src/diary.rs b/lib/domain/libimagdiary/src/diary.rs index 6617f392..8bc94865 100644 --- a/lib/domain/libimagdiary/src/diary.rs +++ b/lib/domain/libimagdiary/src/diary.rs @@ -33,7 +33,7 @@ use diaryid::DiaryId; use error::DiaryError as DE; use error::DiaryErrorKind as DEK; use error::ResultExt; -use result::Result; +use error::Result; use iter::DiaryEntryIterator; use is_in_diary::IsInDiary; diff --git a/lib/domain/libimagdiary/src/entry.rs b/lib/domain/libimagdiary/src/entry.rs index 0148b59d..4e654f5e 100644 --- a/lib/domain/libimagdiary/src/entry.rs +++ b/lib/domain/libimagdiary/src/entry.rs @@ -22,7 +22,7 @@ use std::ops::DerefMut; use libimagstore::store::FileLockEntry; use libimagentryedit::edit::Edit; -use libimagentryedit::result::Result as EditResult; +use libimagentryedit::error::Result as EditResult; use libimagrt::runtime::Runtime; use diaryid::DiaryId; diff --git a/lib/domain/libimagdiary/src/iter.rs b/lib/domain/libimagdiary/src/iter.rs index 285dc34e..63bd0779 100644 --- a/lib/domain/libimagdiary/src/iter.rs +++ b/lib/domain/libimagdiary/src/iter.rs @@ -29,7 +29,7 @@ use is_in_diary::IsInDiary; use entry::Entry as DiaryEntry; use error::DiaryErrorKind as DEK; use error::ResultExt; -use result::Result; +use error::Result; use libimagerror::trace::trace_error; /// A iterator for iterating over diary entries diff --git a/lib/domain/libimagdiary/src/lib.rs b/lib/domain/libimagdiary/src/lib.rs index 90c14679..b9c9697b 100644 --- a/lib/domain/libimagdiary/src/lib.rs +++ b/lib/domain/libimagdiary/src/lib.rs @@ -57,6 +57,5 @@ pub mod diary; pub mod is_in_diary; pub mod entry; pub mod iter; -pub mod result; pub mod viewer; diff --git a/lib/domain/libimagdiary/src/result.rs b/lib/domain/libimagdiary/src/result.rs deleted file mode 100644 index b4f5f382..00000000 --- a/lib/domain/libimagdiary/src/result.rs +++ /dev/null @@ -1,24 +0,0 @@ -// -// imag - the personal information management suite for the commandline -// Copyright (C) 2015, 2016 Matthias Beyer <mail@beyermatthias.de> and contributors -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; version -// 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -// - -use std::result::Result as RResult; - -use error::DiaryError; - -pub type Result<T> = RResult<T, DiaryError>; diff --git a/lib/domain/libimagdiary/src/viewer.rs b/lib/domain/libimagdiary/src/viewer.rs index 9efd293f..e87bc202 100644 --- a/lib/domain/libimagdiary/src/viewer.rs +++ b/lib/domain/libimagdiary/src/viewer.rs @@ -22,7 +22,7 @@ use entry::Entry; use error::DiaryErrorKind as DEK; use error::ResultExt; -use result::Result; +use error::Result; use libimagentryview::viewer::Viewer; use libimagentryview::builtin::plain::PlainViewer; diff --git a/lib/domain/libimagmail/src/hasher.rs b/lib/domain/libimagmail/src/hasher.rs index d650bedd..07817602 100644 --- a/lib/domain/libimagmail/src/hasher.rs +++ b/lib/domain/libimagmail/src/hasher.rs @@ -26,7 +26,7 @@ use libimagentryref::hasher::Hasher; use libimagentryref::hasher::DefaultHasher; use libimagentryref::error::RefErrorKind as REK; use libimagentryref::error::ResultExt; -use libimagentryref::result::Result as RResult; +use libimagentryref::error::Result as RResult; pub struct MailHasher { defaulthasher: DefaultHasher, diff --git a/lib/domain/libimagmail/src/iter.rs b/lib/domain/libimagmail/src/iter.rs index fe1e72a4..92cf2981 100644 --- a/lib/domain/libimagmail/src/iter.rs +++ b/lib/domain/libimagmail/src/iter.rs @@ -25,7 +25,7 @@ //! use mail::Mail; -use result::Result; +use error::Result; use libimagentryref::reference::Ref; diff --git a/lib/domain/libimagmail/src/lib.rs b/lib/domain/libimagmail/src/lib.rs index 09e74a5f..9a6b9413 100644 --- a/lib/domain/libimagmail/src/lib.rs +++ b/lib/domain/libimagmail/src/lib.rs @@ -48,5 +48,4 @@ pub mod error; pub mod hasher; pub mod iter; pub mod mail; -pub mod result; diff --git a/lib/domain/libimagmail/src/mail.rs b/lib/domain/libimagmail/src/mail.rs index 17129c90..426409cc 100644 --- a/lib/domain/libimagmail/src/mail.rs +++ b/lib/domain/libimagmail/src/mail.rs @@ -30,7 +30,7 @@ use email::MimeMessage; use email::results::ParsingResult as EmailParsingResult; use hasher::MailHasher; -use result::Result; +use error::Result; use error::{ResultExt, MailErrorKind as MEK}; struct Buffer(String); diff --git a/lib/domain/libimagmail/src/result.rs b/lib/domain/libimagmail/src/result.rs deleted file mode 100644 index 7f745eda..00000000 --- a/lib/domain/libimagmail/src/result.rs +++ /dev/null @@ -1,25 +0,0 @@ -// -// imag - the personal information management suite for the commandline -// Copyright (C) 2015, 2016 Matthias Beyer <mail@beyermatthias.de> and contributors -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; version -// 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software - |