diff --git a/lib/core/libimagerror/src/lib.rs b/lib/core/libimagerror/src/lib.rs index bc4f865d..0ed1e7f3 100644 --- a/lib/core/libimagerror/src/lib.rs +++ b/lib/core/libimagerror/src/lib.rs @@ -18,6 +18,7 @@ // #![deny( + dead_code, non_camel_case_types, non_snake_case, path_statements, @@ -26,6 +27,7 @@ unused_allocation, unused_import_braces, unused_imports, + unused_must_use, unused_mut, unused_qualifications, while_true, diff --git a/lib/core/libimagstore/src/lib.rs b/lib/core/libimagstore/src/lib.rs index ae205b83..afb40e80 100644 --- a/lib/core/libimagstore/src/lib.rs +++ b/lib/core/libimagstore/src/lib.rs @@ -18,6 +18,7 @@ // #![deny( + dead_code, non_camel_case_types, non_snake_case, path_statements, @@ -26,6 +27,7 @@ unused_allocation, unused_import_braces, unused_imports, + unused_must_use, unused_mut, unused_qualifications, while_true, diff --git a/lib/domain/libimagbookmark/src/lib.rs b/lib/domain/libimagbookmark/src/lib.rs index e576ff1d..e5a34357 100644 --- a/lib/domain/libimagbookmark/src/lib.rs +++ b/lib/domain/libimagbookmark/src/lib.rs @@ -18,6 +18,7 @@ // #![deny( + dead_code, non_camel_case_types, non_snake_case, path_statements, @@ -26,6 +27,7 @@ unused_allocation, unused_import_braces, unused_imports, + unused_must_use, unused_mut, unused_qualifications, while_true, diff --git a/lib/domain/libimagcounter/src/lib.rs b/lib/domain/libimagcounter/src/lib.rs index 09ba1786..13bf7367 100644 --- a/lib/domain/libimagcounter/src/lib.rs +++ b/lib/domain/libimagcounter/src/lib.rs @@ -18,6 +18,7 @@ // #![deny( + dead_code, non_camel_case_types, non_snake_case, path_statements, @@ -26,6 +27,7 @@ unused_allocation, unused_import_braces, unused_imports, + unused_must_use, unused_mut, unused_qualifications, while_true, diff --git a/lib/domain/libimagmail/src/lib.rs b/lib/domain/libimagmail/src/lib.rs index 23c9e60f..ae3fa850 100644 --- a/lib/domain/libimagmail/src/lib.rs +++ b/lib/domain/libimagmail/src/lib.rs @@ -17,6 +17,22 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // +#![deny( + dead_code, + non_camel_case_types, + non_snake_case, + path_statements, + trivial_numeric_casts, + unstable_features, + unused_allocation, + unused_import_braces, + unused_imports, + unused_must_use, + unused_mut, + unused_qualifications, + while_true, +)] + #[macro_use] extern crate log; extern crate email; extern crate semver; diff --git a/lib/domain/libimagmail/src/mail.rs b/lib/domain/libimagmail/src/mail.rs index 11b57398..ede27704 100644 --- a/lib/domain/libimagmail/src/mail.rs +++ b/lib/domain/libimagmail/src/mail.rs @@ -53,6 +53,7 @@ impl<'a> Mail<'a> { /// Imports a mail from the Path passed pub fn import_from_path>(store: &Store, p: P) -> Result { + debug!("Importing Mail from path"); let h = MailHasher::new(); let f = RefFlags::default().with_content_hashing(true).with_permission_tracking(false); let p = PathBuf::from(p.as_ref()); @@ -60,6 +61,7 @@ impl<'a> Mail<'a> { Ref::create_with_hasher(store, p, f, h) .map_err_into(MEK::RefCreationError) .and_then(|reference| { + debug!("Build reference file: {:?}", reference); reference.fs_file() .map_err_into(MEK::RefHandlingError) .and_then(|path| File::open(path).map_err_into(MEK::IOError)) @@ -76,6 +78,7 @@ impl<'a> Mail<'a> { /// Opens a mail by the passed hash pub fn open>(store: &Store, hash: S) -> Result> { + debug!("Opening Mail by Hash"); Ref::get_by_hash(store, String::from(hash.as_ref())) .map_err_into(MEK::FetchByHashError) .map_err_into(MEK::FetchError) @@ -88,6 +91,7 @@ impl<'a> Mail<'a> { /// Implement me as TryFrom as soon as it is stable pub fn from_ref(r: Ref<'a>) -> Result { + debug!("Building Mail object from Ref: {:?}", r); r.fs_file() .map_err_into(MEK::RefHandlingError) .and_then(|path| File::open(path).map_err_into(MEK::IOError)) @@ -102,6 +106,7 @@ impl<'a> Mail<'a> { } pub fn get_field(&self, field: &str) -> Result> { + debug!("Getting field in mail: {:?}", field); self.1 .parsed() .map_err_into(MEK::MailParsingError) diff --git a/lib/domain/libimagtimetrack/src/iter/filter.rs b/lib/domain/libimagtimetrack/src/iter/filter.rs index 0a3ae538..57e9bc61 100644 --- a/lib/domain/libimagtimetrack/src/iter/filter.rs +++ b/lib/domain/libimagtimetrack/src/iter/filter.rs @@ -17,10 +17,7 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // -use result::Result; - use chrono::NaiveDateTime; -use filters::filter::Filter; use libimagstore::store::FileLockEntry; diff --git a/lib/domain/libimagtimetrack/src/iter/mod.rs b/lib/domain/libimagtimetrack/src/iter/mod.rs index 467199d8..294f04c3 100644 --- a/lib/domain/libimagtimetrack/src/iter/mod.rs +++ b/lib/domain/libimagtimetrack/src/iter/mod.rs @@ -30,10 +30,7 @@ mod test { use libimagstore::store::Store; - use super::create::*; - use super::get::*; use super::setendtime::*; - use super::storeid::*; use super::tag::*; fn get_store() -> Store { @@ -53,7 +50,7 @@ mod test { let iter = tags.into_iter().map(String::from); - let iter : SetEndTimeIter = TagIter::new(Box::new(iter)) + let _ : SetEndTimeIter = TagIter::new(Box::new(iter)) .create_storeids(now) .create_entries(&store) .set_end_time(then); diff --git a/lib/domain/libimagtimetrack/src/lib.rs b/lib/domain/libimagtimetrack/src/lib.rs index e3f9d2aa..0e92d2e8 100644 --- a/lib/domain/libimagtimetrack/src/lib.rs +++ b/lib/domain/libimagtimetrack/src/lib.rs @@ -17,6 +17,22 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // +#![deny( + dead_code, + non_camel_case_types, + non_snake_case, + path_statements, + trivial_numeric_casts, + unstable_features, + unused_allocation, + unused_import_braces, + unused_imports, + unused_must_use, + unused_mut, + unused_qualifications, + while_true, +)] + extern crate filters; extern crate chrono; extern crate toml; diff --git a/lib/domain/libimagtodo/src/error.rs b/lib/domain/libimagtodo/src/error.rs index c19a6e52..621d3249 100644 --- a/lib/domain/libimagtodo/src/error.rs +++ b/lib/domain/libimagtodo/src/error.rs @@ -22,7 +22,8 @@ generate_error_module!( ConversionError => "Conversion Error", StoreError => "Store Error", StoreIdError => "Store Id handling error", - ImportError => "Error importing" + ImportError => "Error importing", + UTF8Error => "Encountered non-UTF8 characters while reading input" ); ); diff --git a/lib/domain/libimagtodo/src/lib.rs b/lib/domain/libimagtodo/src/lib.rs index 16fcc11b..c1289f8d 100644 --- a/lib/domain/libimagtodo/src/lib.rs +++ b/lib/domain/libimagtodo/src/lib.rs @@ -18,6 +18,7 @@ // #![deny( + dead_code, non_camel_case_types, non_snake_case, path_statements, @@ -26,6 +27,7 @@ unused_allocation, unused_import_braces, unused_imports, + unused_must_use, unused_mut, unused_qualifications, while_true, diff --git a/lib/domain/libimagtodo/src/task.rs b/lib/domain/libimagtodo/src/task.rs index 5e31d952..303ef14b 100644 --- a/lib/domain/libimagtodo/src/task.rs +++ b/lib/domain/libimagtodo/src/task.rs @@ -48,7 +48,7 @@ impl<'a> Task<'a> { pub fn import(store: &'a Store, mut r: R) -> Result<(Task<'a>, String, Uuid)> { let mut line = String::new(); - r.read_line(&mut line); + try!(r.read_line(&mut line).map_err_into(TEK::UTF8Error)); import_task(&line.as_str()) .map_err_into(TEK::ImportError) .and_then(|t| { @@ -70,7 +70,7 @@ impl<'a> Task<'a> { where R: BufRead { let mut line = String::new(); - r.read_line(&mut line); + try!(r.read_line(&mut line).map_err_into(TEK::UTF8Error)); Task::get_from_string(store, line) } @@ -104,7 +104,7 @@ impl<'a> Task<'a> { /// implicitely create the task if it does not exist. pub fn retrieve_from_import(store: &'a Store, mut r: R) -> Result> { let mut line = String::new(); - r.read_line(&mut line); + try!(r.read_line(&mut line).map_err_into(TEK::UTF8Error)); Task::retrieve_from_string(store, line) } diff --git a/lib/entry/libimagentryannotation/src/lib.rs b/lib/entry/libimagentryannotation/src/lib.rs index 0cb4e779..39129112 100644 --- a/lib/entry/libimagentryannotation/src/lib.rs +++ b/lib/entry/libimagentryannotation/src/lib.rs @@ -17,11 +17,27 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // +#![deny( + dead_code, + non_camel_case_types, + non_snake_case, + path_statements, + trivial_numeric_casts, + unstable_features, + unused_allocation, + unused_import_braces, + unused_imports, + unused_must_use, + unused_mut, + unused_qualifications, + while_true, +)] + extern crate uuid; extern crate toml; #[macro_use] extern crate libimagerror; -#[macro_use] extern crate libimagstore; +extern crate libimagstore; extern crate libimagentrylink; extern crate libimagnotes; extern crate libimagutil; diff --git a/lib/entry/libimagentrycategory/src/lib.rs b/lib/entry/libimagentrycategory/src/lib.rs index 8ffaafc7..c2b4daae 100644 --- a/lib/entry/libimagentrycategory/src/lib.rs +++ b/lib/entry/libimagentrycategory/src/lib.rs @@ -17,6 +17,22 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // +#![deny( + dead_code, + non_camel_case_types, + non_snake_case, + path_statements, + trivial_numeric_casts, + unstable_features, + unused_allocation, + unused_import_braces, + unused_imports, + unused_must_use, + unused_mut, + unused_qualifications, + while_true, +)] + extern crate toml_query; extern crate toml; #[macro_use] diff --git a/lib/entry/libimagentrydatetime/Cargo.toml b/lib/entry/libimagentrydatetime/Cargo.toml index 93e43b8c..a024c6d4 100644 --- a/lib/entry/libimagentrydatetime/Cargo.toml +++ b/lib/entry/libimagentrydatetime/Cargo.toml @@ -23,6 +23,3 @@ libimagerror = { version = "0.4.0", path = "../../../lib/core/libimagerror" } libimagstore = { version = "0.4.0", path = "../../../lib/core/libimagstore" } libimagutil = { version = "0.4.0", path = "../../../lib/etc/libimagutil" } -[dev-dependencies] -is-match = "0.1" - diff --git a/lib/entry/libimagentrydatetime/src/lib.rs b/lib/entry/libimagentrydatetime/src/lib.rs index fb0d73fa..695ce974 100644 --- a/lib/entry/libimagentrydatetime/src/lib.rs +++ b/lib/entry/libimagentrydatetime/src/lib.rs @@ -17,6 +17,22 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // +#![deny( + dead_code, + non_camel_case_types, + non_snake_case, + path_statements, + trivial_numeric_casts, + unstable_features, + unused_allocation, + unused_import_braces, + unused_imports, + unused_must_use, + unused_mut, + unused_qualifications, + while_true, +)] + #[macro_use] extern crate lazy_static; extern crate chrono; extern crate toml_query; @@ -26,9 +42,6 @@ extern crate toml; extern crate libimagstore; extern crate libimagutil; -#[cfg(test)] -#[macro_use] extern crate is_match; - pub mod datepath; pub mod datetime; pub mod error; diff --git a/lib/entry/libimagentryedit/src/lib.rs b/lib/entry/libimagentryedit/src/lib.rs index 00013d5e..9d9187cd 100644 --- a/lib/entry/libimagentryedit/src/lib.rs +++ b/lib/entry/libimagentryedit/src/lib.rs @@ -17,6 +17,22 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // +#![deny( + dead_code, + non_camel_case_types, + non_snake_case, + path_statements, + trivial_numeric_casts, + unstable_features, + unused_allocation, + unused_import_braces, + unused_imports, + unused_must_use, + unused_mut, + unused_qualifications, + while_true, +)] + #[macro_use] extern crate libimagerror; extern crate libimagstore; extern crate libimagrt; diff --git a/lib/entry/libimagentryfilter/src/lib.rs b/lib/entry/libimagentryfilter/src/lib.rs index ad99db60..8b25c379 100644 --- a/lib/entry/libimagentryfilter/src/lib.rs +++ b/lib/entry/libimagentryfilter/src/lib.rs @@ -18,6 +18,7 @@ // #![deny( + dead_code, non_camel_case_types, non_snake_case, path_statements, diff --git a/lib/entry/libimagentrylink/src/lib.rs b/lib/entry/libimagentrylink/src/lib.rs index 2ed8b6ba..71562d9b 100644 --- a/lib/entry/libimagentrylink/src/lib.rs +++ b/lib/entry/libimagentrylink/src/lib.rs @@ -18,6 +18,7 @@ // #![deny( + dead_code, non_camel_case_types, non_snake_case, path_statements, @@ -26,6 +27,7 @@ unused_allocation, unused_import_braces, unused_imports, + unused_must_use, unused_mut, unused_qualifications, while_true, diff --git a/lib/entry/libimagentrymarkdown/src/lib.rs b/lib/entry/libimagentrymarkdown/src/lib.rs index 2efc6094..2d0ad848 100644 --- a/lib/entry/libimagentrymarkdown/src/lib.rs +++ b/lib/entry/libimagentrymarkdown/src/lib.rs @@ -18,6 +18,7 @@ // #![deny( + dead_code, non_camel_case_types, non_snake_case, path_statements, @@ -26,6 +27,7 @@ unused_allocation, unused_import_braces, unused_imports, + unused_must_use, unused_mut, unused_qualifications, while_true, diff --git a/lib/entry/libimagentryref/src/lib.rs b/lib/entry/libimagentryref/src/lib.rs index 86c187d0..b3291135 100644 --- a/lib/entry/libimagentryref/src/lib.rs +++ b/lib/entry/libimagentryref/src/lib.rs @@ -18,6 +18,7 @@ // #![deny( + dead_code, non_camel_case_types, non_snake_case, path_statements, @@ -26,6 +27,7 @@ unused_allocation, unused_import_braces, unused_imports, + unused_must_use, unused_mut, unused_qualifications, while_true, diff --git a/lib/entry/libimagentrytag/src/lib.rs b/lib/entry/libimagentrytag/src/lib.rs index bfc4d461..8c88f9b6 100644 --- a/lib/entry/libimagentrytag/src/lib.rs +++ b/lib/entry/libimagentrytag/src/lib.rs @@ -18,6 +18,7 @@ // #![deny( + dead_code, non_camel_case_types, non_snake_case, path_statements, @@ -26,6 +27,7 @@ unused_allocation, unused_import_braces, unused_imports, + unused_must_use, unused_mut, unused_qualifications, while_true, diff --git a/lib/etc/libimaginteraction/src/lib.rs b/lib/etc/libimaginteraction/src/lib.rs index 67c61cf4..b0663f8b 100644 --- a/lib/etc/libimaginteraction/src/lib.rs +++ b/lib/etc/libimaginteraction/src/lib.rs @@ -18,6 +18,7 @@ // #![deny( + dead_code, non_camel_case_types, non_snake_case, path_statements, @@ -26,6 +27,7 @@ unused_allocation, unused_import_braces, unused_imports, + unused_must_use, unused_mut, unused_qualifications, while_true, diff --git a/lib/etc/libimagtimeui/src/lib.rs b/lib/etc/libimagtimeui/src/lib.rs index b06bba78..b7652b57 100644 --- a/lib/etc/libimagtimeui/src/lib.rs +++ b/lib/etc/libimagtimeui/src/lib.rs @@ -18,6 +18,7 @@ // #![deny( + dead_code, non_camel_case_types, non_snake_case, path_statements, @@ -26,6 +27,7 @@ unused_allocation, unused_import_braces, unused_imports, + unused_must_use, unused_mut, unused_qualifications, while_true, diff --git a/lib/etc/libimagutil/src/lib.rs b/lib/etc/libimagutil/src/lib.rs index b5d30f51..81dce538 100644 --- a/lib/etc/libimagutil/src/lib.rs +++ b/lib/etc/libimagutil/src/lib.rs @@ -18,6 +18,7 @@ // #![deny( + dead_code, non_camel_case_types, non_snake_case, path_statements,