From 1d8984461395c37fdbcd59a0b9488b076084c89a Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Thu, 28 Feb 2019 17:28:32 +0100 Subject: [PATCH] Run 'cargo fix' for rust-2018 With this patch we move the codebase to Rust-2018. The diff was generated by executing cargo fix --all --all-features --edition on the codebase. Signed-off-by: Matthias Beyer --- bin/core/imag-annotate/src/main.rs | 6 ++-- bin/core/imag-category/src/main.rs | 4 +-- bin/core/imag-edit/src/main.rs | 2 +- bin/core/imag-gps/src/main.rs | 6 ++-- bin/core/imag-header/src/main.rs | 2 +- bin/core/imag-ids/src/main.rs | 6 ++-- bin/core/imag-link/src/main.rs | 8 ++--- bin/core/imag-mv/src/main.rs | 2 +- bin/core/imag-ref/src/main.rs | 10 +++--- bin/core/imag-store/src/create.rs | 2 +- bin/core/imag-store/src/delete.rs | 2 +- bin/core/imag-store/src/get.rs | 2 +- bin/core/imag-store/src/main.rs | 14 ++++---- bin/core/imag-store/src/update.rs | 2 +- bin/core/imag-tag/src/main.rs | 4 +-- bin/core/imag-view/src/main.rs | 4 +-- bin/domain/imag-bookmark/src/main.rs | 2 +- bin/domain/imag-contact/src/edit.rs | 2 +- bin/domain/imag-contact/src/main.rs | 8 ++--- bin/domain/imag-diary/src/create.rs | 8 ++--- bin/domain/imag-diary/src/delete.rs | 2 +- bin/domain/imag-diary/src/list.rs | 2 +- bin/domain/imag-diary/src/main.rs | 8 ++--- bin/domain/imag-diary/src/view.rs | 2 +- bin/domain/imag-log/src/main.rs | 2 +- bin/domain/imag-mail/src/main.rs | 4 +-- bin/domain/imag-notes/src/main.rs | 2 +- bin/domain/imag-timetrack/src/main.rs | 20 ++++++------ bin/domain/imag-todo/src/main.rs | 2 +- bin/domain/imag-wiki/src/main.rs | 2 +- lib/core/libimagerror/src/io.rs | 4 +-- lib/core/libimagerror/src/iter.rs | 4 +-- lib/core/libimagrt/src/logger.rs | 2 +- lib/core/libimagrt/src/runtime.rs | 8 ++--- lib/core/libimagrt/src/setup.rs | 2 +- lib/core/libimagstore/src/configuration.rs | 2 +- .../libimagstore/src/file_abstraction/fs.rs | 8 ++--- .../src/file_abstraction/inmemory.rs | 8 ++--- .../libimagstore/src/file_abstraction/iter.rs | 4 +-- .../libimagstore/src/file_abstraction/mod.rs | 12 +++---- lib/core/libimagstore/src/iter.rs | 28 ++++++++-------- lib/core/libimagstore/src/store.rs | 32 +++++++++---------- lib/core/libimagstore/src/storeid.rs | 14 ++++---- lib/domain/libimagbookmark/src/collection.rs | 16 +++++----- lib/domain/libimagcontact/src/contact.rs | 2 +- lib/domain/libimagcontact/src/iter.rs | 2 +- lib/domain/libimagcontact/src/store.rs | 8 ++--- lib/domain/libimagdiary/src/diary.rs | 10 +++--- lib/domain/libimagdiary/src/diaryid.rs | 4 +-- lib/domain/libimagdiary/src/entry.rs | 4 +-- lib/domain/libimagdiary/src/iter.rs | 2 +- lib/domain/libimagdiary/src/viewer.rs | 2 +- lib/domain/libimaghabit/src/habit.rs | 22 ++++++------- lib/domain/libimaghabit/src/instance.rs | 2 +- lib/domain/libimaghabit/src/iter.rs | 2 +- lib/domain/libimaghabit/src/store.rs | 6 ++-- lib/domain/libimaghabit/src/util.rs | 4 +-- lib/domain/libimagmail/src/hasher.rs | 2 +- lib/domain/libimagmail/src/mail.rs | 4 +-- lib/domain/libimagmail/src/store.rs | 14 ++++---- lib/domain/libimagnotes/src/iter.rs | 2 +- lib/domain/libimagnotes/src/notestore.rs | 10 +++--- .../libimagtimetrack/src/iter/create.rs | 6 ++-- .../libimagtimetrack/src/iter/filter.rs | 8 ++--- lib/domain/libimagtimetrack/src/iter/get.rs | 2 +- .../libimagtimetrack/src/iter/setendtime.rs | 4 +-- .../libimagtimetrack/src/iter/storeid.rs | 8 ++--- lib/domain/libimagtimetrack/src/iter/tag.rs | 4 +-- .../libimagtimetrack/src/timetracking.rs | 4 +-- .../libimagtimetrack/src/timetrackingstore.rs | 6 ++-- lib/domain/libimagtodo/src/taskstore.rs | 8 ++--- lib/domain/libimagwiki/src/store.rs | 4 +-- lib/domain/libimagwiki/src/wiki.rs | 12 +++---- .../src/annotateable.rs | 4 +-- .../libimagentrycategory/src/category.rs | 4 +-- lib/entry/libimagentrycategory/src/entry.rs | 2 +- lib/entry/libimagentrycategory/src/iter.rs | 4 +-- lib/entry/libimagentrycategory/src/store.rs | 8 ++--- .../src/datepath/compiler.rs | 8 ++--- .../src/datepath/to_store_id.rs | 2 +- .../libimagentrydatetime/src/datetime.rs | 2 +- .../src/builtin/header/field_eq.rs | 6 ++-- .../src/builtin/header/field_exists.rs | 2 +- .../src/builtin/header/field_grep.rs | 6 ++-- .../src/builtin/header/field_gt.rs | 6 ++-- .../src/builtin/header/field_isempty.rs | 2 +- .../src/builtin/header/field_istype.rs | 6 ++-- .../src/builtin/header/field_lt.rs | 6 ++-- .../src/builtin/header/field_predicate.rs | 4 +-- .../src/builtin/header/version/range.rs | 4 +-- lib/entry/libimagentrygps/src/entry.rs | 4 +-- lib/entry/libimagentrylink/src/external.rs | 10 +++--- lib/entry/libimagentrylink/src/internal.rs | 2 +- .../libimagentrymarkdown/src/processor.rs | 2 +- lib/entry/libimagentryref/src/hasher.rs | 2 +- lib/entry/libimagentryref/src/reference.rs | 8 ++--- lib/entry/libimagentryref/src/util.rs | 2 +- lib/entry/libimagentrytag/src/tagable.rs | 4 +-- .../libimagentryview/src/builtin/editor.rs | 2 +- lib/entry/libimagentryview/src/builtin/md.rs | 2 +- .../libimagentryview/src/builtin/plain.rs | 2 +- .../libimagentryview/src/builtin/stdout.rs | 2 +- lib/etc/libimagtimeui/src/date.rs | 6 ++-- lib/etc/libimagtimeui/src/datetime.rs | 6 ++-- lib/etc/libimagtimeui/src/time.rs | 6 ++-- 105 files changed, 295 insertions(+), 295 deletions(-) diff --git a/bin/core/imag-annotate/src/main.rs b/bin/core/imag-annotate/src/main.rs index ada33757..f4ad2093 100644 --- a/bin/core/imag-annotate/src/main.rs +++ b/bin/core/imag-annotate/src/main.rs @@ -97,7 +97,7 @@ fn main() { fn add(rt: &Runtime) { let scmd = rt.cli().subcommand_matches("add").unwrap(); // safed by main() - let mut ids = rt.ids::<::ui::PathProvider>().map_err_trace_exit_unwrap().into_iter(); + let mut ids = rt.ids::().map_err_trace_exit_unwrap().into_iter(); if let Some(first) = ids.next() { let mut annotation = rt.store() @@ -144,7 +144,7 @@ fn remove(rt: &Runtime) { let scmd = rt.cli().subcommand_matches("remove").unwrap(); // safed by main() let annotation_name = scmd.value_of("annotation_name").unwrap(); // safed by clap let delete = scmd.is_present("delete-annotation"); - let ids = rt.ids::<::ui::PathProvider>().map_err_trace_exit_unwrap(); + let ids = rt.ids::().map_err_trace_exit_unwrap(); ids.into_iter().for_each(|id| { let mut entry = rt.store() @@ -181,7 +181,7 @@ fn remove(rt: &Runtime) { fn list(rt: &Runtime) { let scmd = rt.cli().subcommand_matches("list").unwrap(); // safed by clap let with_text = scmd.is_present("list-with-text"); - let ids = rt.ids::<::ui::PathProvider>().map_err_trace_exit_unwrap(); + let ids = rt.ids::().map_err_trace_exit_unwrap(); if ids.len() != 0 { let _ = ids diff --git a/bin/core/imag-category/src/main.rs b/bin/core/imag-category/src/main.rs index 96882e41..9629da7f 100644 --- a/bin/core/imag-category/src/main.rs +++ b/bin/core/imag-category/src/main.rs @@ -92,7 +92,7 @@ fn main() { fn set(rt: &Runtime) { let scmd = rt.cli().subcommand_matches("set").unwrap(); // safed by main() let name = scmd.value_of("set-name").map(String::from).unwrap(); // safed by clap - let sids = rt.ids::<::ui::PathProvider>().map_err_trace_exit_unwrap(); + let sids = rt.ids::().map_err_trace_exit_unwrap(); StoreIdIterator::new(Box::new(sids.into_iter().map(Ok))) .into_get_iter(rt.store()) @@ -109,7 +109,7 @@ fn set(rt: &Runtime) { } fn get(rt: &Runtime) { - let sids = rt.ids::<::ui::PathProvider>().map_err_trace_exit_unwrap(); + let sids = rt.ids::().map_err_trace_exit_unwrap(); let out = rt.stdout(); let mut outlock = out.lock(); diff --git a/bin/core/imag-edit/src/main.rs b/bin/core/imag-edit/src/main.rs index c0a97dd5..9f8263bb 100644 --- a/bin/core/imag-edit/src/main.rs +++ b/bin/core/imag-edit/src/main.rs @@ -63,7 +63,7 @@ fn main() { let edit_header = rt.cli().is_present("edit-header"); let edit_header_only = rt.cli().is_present("edit-header-only"); - let sids = rt.ids::<::ui::PathProvider>().map_err_trace_exit_unwrap(); + let sids = rt.ids::().map_err_trace_exit_unwrap(); StoreIdIterator::new(Box::new(sids.into_iter().map(Ok))) .into_get_iter(rt.store()) diff --git a/bin/core/imag-gps/src/main.rs b/bin/core/imag-gps/src/main.rs index 6ca785d4..0b34605f 100644 --- a/bin/core/imag-gps/src/main.rs +++ b/bin/core/imag-gps/src/main.rs @@ -124,7 +124,7 @@ fn add(rt: &Runtime) { Coordinates::new(long, lati) }; - rt.ids::<::ui::PathProvider>() + rt.ids::() .map_err_trace_exit_unwrap() .into_iter() .for_each(|id| { @@ -149,7 +149,7 @@ fn remove(rt: &Runtime) { .unwrap() .is_present("print-removed"); // safed by main() - rt.ids::<::ui::PathProvider>() + rt.ids::() .map_err_trace_exit_unwrap() .into_iter() .for_each(|id| { @@ -179,7 +179,7 @@ fn remove(rt: &Runtime) { fn get(rt: &Runtime) { let mut stdout = rt.stdout(); - rt.ids::<::ui::PathProvider>() + rt.ids::() .map_err_trace_exit_unwrap() .into_iter() .for_each(|id| { diff --git a/bin/core/imag-header/src/main.rs b/bin/core/imag-header/src/main.rs index 1ee8440c..3e7b01da 100644 --- a/bin/core/imag-header/src/main.rs +++ b/bin/core/imag-header/src/main.rs @@ -79,7 +79,7 @@ fn main() { trace!("list_output_with_ids = {:?}", list_output_with_ids ); trace!("list_output_with_ids_fmt = {:?}", list_output_with_ids_fmt); - let sids = rt.ids::<::ui::PathProvider>().map_err_trace_exit_unwrap(); + let sids = rt.ids::().map_err_trace_exit_unwrap(); let iter = StoreIdIterator::new(Box::new(sids.into_iter().map(Ok))) .into_get_iter(rt.store()) diff --git a/bin/core/imag-ids/src/main.rs b/bin/core/imag-ids/src/main.rs index b0b84199..dbe271b2 100644 --- a/bin/core/imag-ids/src/main.rs +++ b/bin/core/imag-ids/src/main.rs @@ -65,8 +65,8 @@ use libimagerror::io::ToExitCode; mod id_filters; mod ui; -use ui::build_ui; -use id_filters::IsInCollectionsFilter; +use crate::ui::build_ui; +use crate::id_filters::IsInCollectionsFilter; fn main() { let version = make_imag_version!(); @@ -93,7 +93,7 @@ fn main() { let iterator = if rt.ids_from_stdin() { debug!("Fetching IDs from stdin..."); - let ids = rt.ids::<::ui::PathProvider>().map_err_trace_exit_unwrap(); + let ids = rt.ids::().map_err_trace_exit_unwrap(); Box::new(ids.into_iter().map(Ok)) as Box>> } else { diff --git a/bin/core/imag-link/src/main.rs b/bin/core/imag-link/src/main.rs index fedda184..0255f341 100644 --- a/bin/core/imag-link/src/main.rs +++ b/bin/core/imag-link/src/main.rs @@ -79,7 +79,7 @@ use failure::Fallible as Result; mod ui; -use ui::build_ui; +use crate::ui::build_ui; fn main() { let version = make_imag_version!(); @@ -209,7 +209,7 @@ fn remove_linking(rt: &Runtime) { }) .unwrap(); - rt.ids::<::ui::PathProvider>() + rt.ids::() .map_err_trace_exit_unwrap() .into_iter() .for_each(|id| match rt.store().get(id.clone()) { @@ -245,7 +245,7 @@ fn remove_linking(rt: &Runtime) { } fn unlink(rt: &Runtime) { - rt.ids::<::ui::PathProvider>().map_err_trace_exit_unwrap().into_iter().for_each(|id| { + rt.ids::().map_err_trace_exit_unwrap().into_iter().for_each(|id| { rt.store() .get(id.clone()) .map_err_trace_exit_unwrap() @@ -271,7 +271,7 @@ fn list_linkings(rt: &Runtime) { let mut tab = ::prettytable::Table::new(); tab.set_titles(row!["#", "Link"]); - rt.ids::<::ui::PathProvider>().map_err_trace_exit_unwrap().into_iter().for_each(|id| { + rt.ids::().map_err_trace_exit_unwrap().into_iter().for_each(|id| { match rt.store().get(id.clone()) { Ok(Some(entry)) => { for (i, link) in entry.get_internal_links().map_err_trace_exit_unwrap().enumerate() { diff --git a/bin/core/imag-mv/src/main.rs b/bin/core/imag-mv/src/main.rs index f5d4d341..9f2fde74 100644 --- a/bin/core/imag-mv/src/main.rs +++ b/bin/core/imag-mv/src/main.rs @@ -45,7 +45,7 @@ extern crate libimagentrylink; use std::process::exit; mod ui; -use ui::build_ui; +use crate::ui::build_ui; use std::path::PathBuf; diff --git a/bin/core/imag-ref/src/main.rs b/bin/core/imag-ref/src/main.rs index bd9f6ed6..197a530a 100644 --- a/bin/core/imag-ref/src/main.rs +++ b/bin/core/imag-ref/src/main.rs @@ -46,7 +46,7 @@ extern crate libimaginteraction; extern crate libimagutil; mod ui; -use ui::build_ui; +use crate::ui::build_ui; use std::process::exit; use std::io::Write; @@ -92,7 +92,7 @@ fn main() { fn deref(rt: &Runtime) { let cmd = rt.cli().subcommand_matches("deref").unwrap(); let basepath = cmd.value_of("override-basepath"); - let ids = rt.ids::<::ui::PathProvider>().map_err_trace_exit_unwrap(); + let ids = rt.ids::().map_err_trace_exit_unwrap(); let cfg = get_ref_config(&rt, "imag-ref").map_err_trace_exit_unwrap(); let out = rt.stdout(); let mut outlock = out.lock(); @@ -130,7 +130,7 @@ fn remove(rt: &Runtime) { let cmd = rt.cli().subcommand_matches("remove").unwrap(); let yes = cmd.is_present("yes"); - let ids = rt.ids::<::ui::PathProvider>().map_err_trace_exit_unwrap(); + let ids = rt.ids::().map_err_trace_exit_unwrap(); let mut input = rt.stdin().unwrap_or_else(|| { error!("No input stream. Cannot ask for permission"); @@ -169,7 +169,7 @@ fn list_dead(rt: &Runtime) { let list_id = cmd.is_present("list-dead-ids"); let mut output = rt.stdout(); - rt.ids::<::ui::PathProvider>() + rt.ids::() .map_err_trace_exit_unwrap() .into_iter() .for_each(|id| { @@ -204,7 +204,7 @@ fn list_dead(rt: &Runtime) { }); } -fn create(rt: &Runtime) { +fn create(_rt: &Runtime) { unimplemented!() } diff --git a/bin/core/imag-store/src/create.rs b/bin/core/imag-store/src/create.rs index 8b6cc2e2..dcb5c686 100644 --- a/bin/core/imag-store/src/create.rs +++ b/bin/core/imag-store/src/create.rs @@ -35,7 +35,7 @@ use libimagerror::trace::MapErrTrace; use libimagerror::exit::ExitUnwrap; use libimagutil::debug_result::*; -use util::build_toml_header; +use crate::util::build_toml_header; pub fn create(rt: &Runtime) { let scmd = rt.cli().subcommand_matches("create").unwrap(); diff --git a/bin/core/imag-store/src/delete.rs b/bin/core/imag-store/src/delete.rs index 50c73d97..c3a9a052 100644 --- a/bin/core/imag-store/src/delete.rs +++ b/bin/core/imag-store/src/delete.rs @@ -39,7 +39,7 @@ pub fn delete(rt: &Runtime) { #[cfg(test)] mod tests { - use create::create; + use crate::create::create; use super::delete; use std::path::PathBuf; diff --git a/bin/core/imag-store/src/get.rs b/bin/core/imag-store/src/get.rs index bf9a1eea..6885f594 100644 --- a/bin/core/imag-store/src/get.rs +++ b/bin/core/imag-store/src/get.rs @@ -24,7 +24,7 @@ use libimagerror::trace::MapErrTrace; use libimagerror::exit::ExitUnwrap; use libimagstore::storeid::StoreId; -use retrieve::print_entry; +use crate::retrieve::print_entry; pub fn get(rt: &Runtime) { let scmd = rt.cli().subcommand_matches("get").unwrap(); diff --git a/bin/core/imag-store/src/main.rs b/bin/core/imag-store/src/main.rs index 7c0c0f10..6ba6ad98 100644 --- a/bin/core/imag-store/src/main.rs +++ b/bin/core/imag-store/src/main.rs @@ -65,13 +65,13 @@ mod util; use std::ops::Deref; -use create::create; -use delete::delete; -use get::get; -use retrieve::retrieve; -use ui::build_ui; -use update::update; -use verify::verify; +use crate::create::create; +use crate::delete::delete; +use crate::get::get; +use crate::retrieve::retrieve; +use crate::ui::build_ui; +use crate::update::update; +use crate::verify::verify; fn main() { let version = make_imag_version!(); diff --git a/bin/core/imag-store/src/update.rs b/bin/core/imag-store/src/update.rs index c2687973..4ce5ac44 100644 --- a/bin/core/imag-store/src/update.rs +++ b/bin/core/imag-store/src/update.rs @@ -25,7 +25,7 @@ use libimagerror::trace::MapErrTrace; use libimagerror::exit::ExitUnwrap; use libimagstore::storeid::StoreId; -use util::build_toml_header; +use crate::util::build_toml_header; pub fn update(rt: &Runtime) { let scmd = rt.cli().subcommand_matches("update").unwrap(); diff --git a/bin/core/imag-tag/src/main.rs b/bin/core/imag-tag/src/main.rs index e3ba7f20..9f1f9bf4 100644 --- a/bin/core/imag-tag/src/main.rs +++ b/bin/core/imag-tag/src/main.rs @@ -75,7 +75,7 @@ use clap::ArgMatches; mod ui; -use ui::build_ui; +use crate::ui::build_ui; fn main() { let version = make_imag_version!(); @@ -84,7 +84,7 @@ fn main() { "Direct interface to the store. Use with great care!", build_ui); - let ids = rt.ids::<::ui::PathProvider>().map_err_trace_exit_unwrap(); + let ids = rt.ids::().map_err_trace_exit_unwrap(); rt.cli() .subcommand_name() diff --git a/bin/core/imag-view/src/main.rs b/bin/core/imag-view/src/main.rs index 1dca0c79..7ffe61b5 100644 --- a/bin/core/imag-view/src/main.rs +++ b/bin/core/imag-view/src/main.rs @@ -71,7 +71,7 @@ use libimagstore::iter::get::StoreIdGetIteratorExtension; use libimagstore::store::FileLockEntry; mod ui; -use ui::build_ui; +use crate::ui::build_ui; fn main() { let version = make_imag_version!(); @@ -82,7 +82,7 @@ fn main() { let view_header = rt.cli().is_present("view-header"); let hide_content = rt.cli().is_present("not-view-content"); - let entries = rt.ids::<::ui::PathProvider>() + let entries = rt.ids::() .map_err_trace_exit_unwrap() .into_iter() .map(Ok) diff --git a/bin/domain/imag-bookmark/src/main.rs b/bin/domain/imag-bookmark/src/main.rs index c7b942cb..90a98979 100644 --- a/bin/domain/imag-bookmark/src/main.rs +++ b/bin/domain/imag-bookmark/src/main.rs @@ -63,7 +63,7 @@ use libimagutil::debug_result::DebugResult; mod ui; -use ui::build_ui; +use crate::ui::build_ui; fn main() { let version = make_imag_version!(); diff --git a/bin/domain/imag-contact/src/edit.rs b/bin/domain/imag-contact/src/edit.rs index bcb89900..1c7a2ae6 100644 --- a/bin/domain/imag-contact/src/edit.rs +++ b/bin/domain/imag-contact/src/edit.rs @@ -68,7 +68,7 @@ pub fn edit(rt: &Runtime) { exit(1) }); - ::util::find_contact_by_hash(rt, hash) + crate::util::find_contact_by_hash(rt, hash) .for_each(|contact| { loop { let res = edit_contact(&rt, &contact, &ref_config, collection_name, force_override); diff --git a/bin/domain/imag-contact/src/main.rs b/bin/domain/imag-contact/src/main.rs index 324d41a6..bf472bb6 100644 --- a/bin/domain/imag-contact/src/main.rs +++ b/bin/domain/imag-contact/src/main.rs @@ -82,10 +82,10 @@ mod util; mod create; mod edit; -use ui::build_ui; -use util::build_data_object_for_handlebars; -use create::create; -use edit::edit; +use crate::ui::build_ui; +use crate::util::build_data_object_for_handlebars; +use crate::create::create; +use crate::edit::edit; fn main() { let version = make_imag_version!(); diff --git a/bin/domain/imag-diary/src/create.rs b/bin/domain/imag-diary/src/create.rs index 423a701e..af6d7fe9 100644 --- a/bin/domain/imag-diary/src/create.rs +++ b/bin/domain/imag-diary/src/create.rs @@ -36,9 +36,9 @@ use libimagutil::debug_option::DebugOption; use libimagstore::store::FileLockEntry; use libimagstore::store::Store; -use util::get_diary_name; -use util::get_diary_timed_config; -use util::Timed; +use crate::util::get_diary_name; +use crate::util::get_diary_timed_config; +use crate::util::Timed; pub fn create(rt: &Runtime) { let diaryname = get_diary_name(rt) @@ -61,7 +61,7 @@ pub fn create(rt: &Runtime) { } fn create_entry<'a>(diary: &'a Store, diaryname: &str, rt: &Runtime) -> FileLockEntry<'a> { - use util::parse_timed_string; + use crate::util::parse_timed_string; let create = rt.cli().subcommand_matches("create").unwrap(); diff --git a/bin/domain/imag-diary/src/delete.rs b/bin/domain/imag-diary/src/delete.rs index 12301800..9de65687 100644 --- a/bin/domain/imag-diary/src/delete.rs +++ b/bin/domain/imag-diary/src/delete.rs @@ -30,7 +30,7 @@ use libimagstore::storeid::IntoStoreId; use libimagerror::trace::MapErrTrace; use libimagerror::exit::ExitUnwrap; -use util::get_diary_name; +use crate::util::get_diary_name; pub fn delete(rt: &Runtime) { use libimaginteraction::ask::ask_bool; diff --git a/bin/domain/imag-diary/src/list.rs b/bin/domain/imag-diary/src/list.rs index b551bd11..3d07f6fa 100644 --- a/bin/domain/imag-diary/src/list.rs +++ b/bin/domain/imag-diary/src/list.rs @@ -33,7 +33,7 @@ use libimagstore::storeid::IntoStoreId; use failure::Fallible as Result; -use util::get_diary_name; +use crate::util::get_diary_name; pub fn list(rt: &Runtime) { let diaryname = get_diary_name(rt) diff --git a/bin/domain/imag-diary/src/main.rs b/bin/domain/imag-diary/src/main.rs index 055911c7..cf5c3fd2 100644 --- a/bin/domain/imag-diary/src/main.rs +++ b/bin/domain/imag-diary/src/main.rs @@ -67,10 +67,10 @@ mod ui; mod util; mod view; -use create::create; -use delete::delete; -use list::list; -use view::view; +use crate::create::create; +use crate::delete::delete; +use crate::list::list; +use crate::view::view; fn main() { let version = make_imag_version!(); diff --git a/bin/domain/imag-diary/src/view.rs b/bin/domain/imag-diary/src/view.rs index 9f0acbaa..9acab804 100644 --- a/bin/domain/imag-diary/src/view.rs +++ b/bin/domain/imag-diary/src/view.rs @@ -27,7 +27,7 @@ use libimagutil::warn_exit::warn_exit; use libimagstore::iter::get::StoreIdGetIteratorExtension; use libimagentryview::viewer::Viewer; -use util::get_diary_name; +use crate::util::get_diary_name; pub fn view(rt: &Runtime) { let diaryname = get_diary_name(rt).unwrap_or_else(|| warn_exit("No diary name", 1)); diff --git a/bin/domain/imag-log/src/main.rs b/bin/domain/imag-log/src/main.rs index 6110dd90..3ecd4923 100644 --- a/bin/domain/imag-log/src/main.rs +++ b/bin/domain/imag-log/src/main.rs @@ -71,7 +71,7 @@ use libimagstore::iter::get::StoreIdGetIteratorExtension; use libimagstore::store::FileLockEntry; mod ui; -use ui::build_ui; +use crate::ui::build_ui; use toml::Value; use itertools::Itertools; diff --git a/bin/domain/imag-mail/src/main.rs b/bin/domain/imag-mail/src/main.rs index 8f7418df..bd6cf9a3 100644 --- a/bin/domain/imag-mail/src/main.rs +++ b/bin/domain/imag-mail/src/main.rs @@ -71,7 +71,7 @@ use libimagstore::iter::get::StoreIdGetIteratorExtension; mod ui; -use ui::build_ui; +use crate::ui::build_ui; fn main() { let version = make_imag_version!(); @@ -215,7 +215,7 @@ fn list(rt: &Runtime) { } if rt.ids_from_stdin() { - let iter = rt.ids::<::ui::PathProvider>() + let iter = rt.ids::() .map_err_trace_exit_unwrap() .into_iter() .map(Ok); diff --git a/bin/domain/imag-notes/src/main.rs b/bin/domain/imag-notes/src/main.rs index 3d7be38d..5c06a4b5 100644 --- a/bin/domain/imag-notes/src/main.rs +++ b/bin/domain/imag-notes/src/main.rs @@ -65,7 +65,7 @@ use libimagutil::warn_result::WarnResult; mod ui; -use ui::build_ui; +use crate::ui::build_ui; fn main() { let version = make_imag_version!(); diff --git a/bin/domain/imag-timetrack/src/main.rs b/bin/domain/imag-timetrack/src/main.rs index af7f1414..2862b6d7 100644 --- a/bin/domain/imag-timetrack/src/main.rs +++ b/bin/domain/imag-timetrack/src/main.rs @@ -62,16 +62,16 @@ mod ui; mod week; mod year; -use cont::cont; -use day::day; -use list::{list, list_impl}; -use month::month; -use start::start; -use stop::stop; -use track::track; -use ui::build_ui; -use week::week; -use year::year; +use crate::cont::cont; +use crate::day::day; +use crate::list::{list, list_impl}; +use crate::month::month; +use crate::start::start; +use crate::stop::stop; +use crate::track::track; +use crate::ui::build_ui; +use crate::week::week; +use crate::year::year; use libimagrt::setup::generate_runtime_setup; use libimagerror::trace::MapErrTrace; diff --git a/bin/domain/imag-todo/src/main.rs b/bin/domain/imag-todo/src/main.rs index d62eabb2..3a2eb55b 100644 --- a/bin/domain/imag-todo/src/main.rs +++ b/bin/domain/imag-todo/src/main.rs @@ -60,7 +60,7 @@ use libimagerror::io::ToExitCode; mod ui; -use ui::build_ui; +use crate::ui::build_ui; fn main() { let version = make_imag_version!(); let rt = generate_runtime_setup("imag-todo", diff --git a/bin/domain/imag-wiki/src/main.rs b/bin/domain/imag-wiki/src/main.rs index 17f08251..1556abbb 100644 --- a/bin/domain/imag-wiki/src/main.rs +++ b/bin/domain/imag-wiki/src/main.rs @@ -44,7 +44,7 @@ use libimagwiki::store::WikiStore; use libimagentryedit::edit::{Edit, EditHeader}; mod ui; -use ui::build_ui; +use crate::ui::build_ui; fn main() { let version = make_imag_version!(); diff --git a/lib/core/libimagerror/src/io.rs b/lib/core/libimagerror/src/io.rs index 38940484..d8abf0b1 100644 --- a/lib/core/libimagerror/src/io.rs +++ b/lib/core/libimagerror/src/io.rs @@ -19,7 +19,7 @@ use std::io::ErrorKind; -use exit::ExitCode; +use crate::exit::ExitCode; pub enum Settings { Ignore(ErrorKind), @@ -28,7 +28,7 @@ pub enum Settings { pub trait ToExitCode { fn to_exit_code(self) -> Result; - fn to_exit_code_with(self, Settings) -> Result; + fn to_exit_code_with(self, _: Settings) -> Result; } impl ToExitCode for Result { diff --git a/lib/core/libimagerror/src/iter.rs b/lib/core/libimagerror/src/iter.rs index e5cf7125..5a288321 100644 --- a/lib/core/libimagerror/src/iter.rs +++ b/lib/core/libimagerror/src/iter.rs @@ -62,7 +62,7 @@ impl Iterator for UnwrapExit type Item = T; fn next(&mut self) -> Option { - use trace::MapErrTrace; + use crate::trace::MapErrTrace; self.0.next().map(|e| e.map_err_trace_exit_unwrap()) } } @@ -71,7 +71,7 @@ impl DoubleEndedIterator for UnwrapExit where I: DoubleEndedIterator>, { fn next_back(&mut self) -> Option { - use trace::MapErrTrace; + use crate::trace::MapErrTrace; self.0.next_back().map(|e| e.map_err_trace_exit_unwrap()) } } diff --git a/lib/core/libimagrt/src/logger.rs b/lib/core/libimagrt/src/logger.rs index 585f2855..3090fb3f 100644 --- a/lib/core/libimagrt/src/logger.rs +++ b/lib/core/libimagrt/src/logger.rs @@ -24,7 +24,7 @@ use std::sync::Arc; use std::sync::Mutex; use std::ops::Deref; -use runtime::Runtime; +use crate::runtime::Runtime; use failure::ResultExt; use failure::Fallible as Result; diff --git a/lib/core/libimagrt/src/runtime.rs b/lib/core/libimagrt/src/runtime.rs index 6eadc12c..a4cba80f 100644 --- a/lib/core/libimagrt/src/runtime.rs +++ b/lib/core/libimagrt/src/runtime.rs @@ -37,9 +37,9 @@ use failure::Fallible as Result; use failure::Error; use failure::err_msg; -use configuration::{fetch_config, override_config, InternalConfiguration}; -use logger::ImagLogger; -use io::OutputProxy; +use crate::configuration::{fetch_config, override_config, InternalConfiguration}; +use crate::logger::ImagLogger; +use crate::io::OutputProxy; use libimagerror::exit::ExitCode; use libimagerror::errors::ErrorMsg as EM; @@ -48,7 +48,7 @@ use libimagerror::io::ToExitCode; use libimagstore::store::Store; use libimagstore::storeid::StoreId; use libimagutil::debug_result::DebugResult; -use spec::CliSpec; +use crate::spec::CliSpec; use atty; /// The Runtime object diff --git a/lib/core/libimagrt/src/setup.rs b/lib/core/libimagrt/src/setup.rs index 6a6a9182..f226d9e3 100644 --- a/lib/core/libimagrt/src/setup.rs +++ b/lib/core/libimagrt/src/setup.rs @@ -19,7 +19,7 @@ use clap::App; -use runtime::Runtime; +use crate::runtime::Runtime; pub type Name = &'static str; pub type Version<'a> = &'a str; diff --git a/lib/core/libimagstore/src/configuration.rs b/lib/core/libimagstore/src/configuration.rs index 6a8beb8a..d0b3452d 100644 --- a/lib/core/libimagstore/src/configuration.rs +++ b/lib/core/libimagstore/src/configuration.rs @@ -45,7 +45,7 @@ pub fn config_implicit_store_create_allowed(config: &Option) -> Result>>>; diff --git a/lib/core/libimagstore/src/file_abstraction/iter.rs b/lib/core/libimagstore/src/file_abstraction/iter.rs index 6bd476a1..c15949df 100644 --- a/lib/core/libimagstore/src/file_abstraction/iter.rs +++ b/lib/core/libimagstore/src/file_abstraction/iter.rs @@ -23,8 +23,8 @@ use std::fmt::Debug; use failure::Fallible as Result; -use storeid::StoreIdWithBase; -use file_abstraction::FileAbstraction; +use crate::storeid::StoreIdWithBase; +use crate::file_abstraction::FileAbstraction; /// See documentation for PathIterator pub(crate) trait PathIterBuilder : Debug { diff --git a/lib/core/libimagstore/src/file_abstraction/mod.rs b/lib/core/libimagstore/src/file_abstraction/mod.rs index 9a80293e..a8fbf403 100644 --- a/lib/core/libimagstore/src/file_abstraction/mod.rs +++ b/lib/core/libimagstore/src/file_abstraction/mod.rs @@ -24,8 +24,8 @@ use std::sync::Arc; use failure::Fallible as Result; -use store::Entry; -use storeid::StoreIdWithBase; +use crate::store::Entry; +use crate::storeid::StoreIdWithBase; pub mod fs; pub mod inmemory; @@ -40,8 +40,8 @@ pub(crate) trait FileAbstraction : Debug { fn rename(&self, from: &PathBuf, to: &PathBuf) -> Result<()>; fn create_dir_all(&self, _: &PathBuf) -> Result<()>; - fn exists(&self, &PathBuf) -> Result; - fn is_file(&self, &PathBuf) -> Result; + fn exists(&self, _: &PathBuf) -> Result; + fn is_file(&self, _: &PathBuf) -> Result; fn new_instance(&self, p: PathBuf) -> Box; @@ -97,8 +97,8 @@ mod test { use super::FileAbstractionInstance; use super::inmemory::InMemoryFileAbstraction; use super::inmemory::InMemoryFileAbstractionInstance; - use storeid::StoreIdWithBase; - use store::Entry; + use crate::storeid::StoreIdWithBase; + use crate::store::Entry; #[test] fn lazy_file() { diff --git a/lib/core/libimagstore/src/iter.rs b/lib/core/libimagstore/src/iter.rs index 1aba5a58..4e66fb6e 100644 --- a/lib/core/libimagstore/src/iter.rs +++ b/lib/core/libimagstore/src/iter.rs @@ -27,10 +27,10 @@ macro_rules! mk_iterator_mod { fun = $fun:expr } => { pub mod $modname { - use storeid::StoreId; + use crate::storeid::StoreId; #[allow(unused_imports)] - use store::FileLockEntry; - use store::Store; + use crate::store::FileLockEntry; + use crate::store::Store; use failure::Fallible as Result; pub struct $itername<'a>(Box> + 'a>, &'a Store); @@ -109,8 +109,8 @@ mod compile_test { // This module contains code to check whether this actually compiles the way we would like it to // compile - use store::Store; - use storeid::StoreId; + use crate::store::Store; + use crate::storeid::StoreId; fn store() -> Store { unimplemented!("Not implemented because in compile-test") @@ -137,13 +137,13 @@ mod compile_test { } } -use storeid::StoreId; -use storeid::StoreIdIterator; +use crate::storeid::StoreId; +use crate::storeid::StoreIdIterator; use self::delete::StoreDeleteIterator; use self::get::StoreGetIterator; use self::retrieve::StoreRetrieveIterator; -use file_abstraction::iter::PathIterator; -use store::Store; +use crate::file_abstraction::iter::PathIterator; +use crate::store::Store; use failure::Fallible as Result; /// Iterator for iterating over all (or a subset of all) entries @@ -186,8 +186,8 @@ impl<'a> Entries<'a> { /// Revisit whether this can be done in a cleaner way. See commit message for why this is /// needed. pub fn into_storeid_iter(self) -> StoreIdIterator { - use storeid::StoreIdWithBase; - use storeid::IntoStoreId; + use crate::storeid::StoreIdWithBase; + use crate::storeid::IntoStoreId; let storepath = self.1.path().to_path_buf(); @@ -243,9 +243,9 @@ mod tests { let _ = env_logger::try_init(); } - use store::Store; - use storeid::StoreId; - use file_abstraction::inmemory::InMemoryFileAbstraction; + use crate::store::Store; + use crate::storeid::StoreId; + use crate::file_abstraction::inmemory::InMemoryFileAbstraction; use libimagutil::variants::generate_variants; pub fn get_store() -> Store { diff --git a/lib/core/libimagstore/src/store.rs b/lib/core/libimagstore/src/store.rs index 3cd0bfeb..8c45fa45 100644 --- a/lib/core/libimagstore/src/store.rs +++ b/lib/core/libimagstore/src/store.rs @@ -41,12 +41,12 @@ use failure::ResultExt; use failure::err_msg; use failure::Error; -use storeid::{IntoStoreId, StoreId}; -use iter::Entries; -use file_abstraction::FileAbstraction; -use file_abstraction::FileAbstractionInstance; -use file_abstraction::fs::FSFileAbstraction; -use file_abstraction::inmemory::InMemoryFileAbstraction; +use crate::storeid::{IntoStoreId, StoreId}; +use crate::iter::Entries; +use crate::file_abstraction::FileAbstraction; +use crate::file_abstraction::FileAbstractionInstance; +use crate::file_abstraction::fs::FSFileAbstraction; +use crate::file_abstraction::inmemory::InMemoryFileAbstraction; use libimagutil::debug_result::*; @@ -188,7 +188,7 @@ impl Store { pub(crate) fn new_with_backend(location: PathBuf, store_config: &Option, backend: Arc) -> Result { - use configuration::*; + use crate::configuration::*; debug!("Building new Store object"); if !location.exists() { @@ -813,7 +813,7 @@ impl Entry { /// - Header cannot be parsed into a TOML object /// pub fn from_str(loc: S, s: &str) -> Result { - use util::entry_buffer_to_header_content; + use crate::util::entry_buffer_to_header_content; let (header, content) = entry_buffer_to_header_content(s)?; @@ -865,7 +865,7 @@ impl Entry { /// /// If an error is returned, the contents of neither the header nor the content are modified. pub fn replace_from_buffer(&mut self, buf: &str) -> Result<()> { - let (header, content) = ::util::entry_buffer_to_header_content(buf)?; + let (header, content) = crate::util::entry_buffer_to_header_content(buf)?; self.content = content; self.header = header; Ok(()) @@ -931,9 +931,9 @@ mod test { extern crate env_logger; use std::collections::BTreeMap; - use storeid::StoreId; - use store::has_main_section; - use store::has_imag_version_in_main_section; + use crate::storeid::StoreId; + use crate::store::has_main_section; + use crate::store::has_imag_version_in_main_section; use toml::Value; @@ -1058,7 +1058,7 @@ mod store_tests { use super::Store; pub fn get_store() -> Store { - use file_abstraction::inmemory::InMemoryFileAbstraction; + use crate::file_abstraction::inmemory::InMemoryFileAbstraction; let backend = Arc::new(InMemoryFileAbstraction::default()); Store::new_with_backend(PathBuf::from("/"), &None, backend).unwrap() } @@ -1141,7 +1141,7 @@ mod store_tests { #[test] fn test_store_create_in_hm() { - use storeid::StoreId; + use crate::storeid::StoreId; let store = get_store(); @@ -1156,7 +1156,7 @@ mod store_tests { #[test] fn test_store_retrieve_in_hm() { - use storeid::StoreId; + use crate::storeid::StoreId; let store = get_store(); @@ -1195,7 +1195,7 @@ mod store_tests { #[test] fn test_store_move_moves_in_hm() { - use storeid::StoreId; + use crate::storeid::StoreId; setup_logging(); let store = get_store(); diff --git a/lib/core/libimagstore/src/storeid.rs b/lib/core/libimagstore/src/storeid.rs index 56177ea5..2c504f2c 100644 --- a/lib/core/libimagstore/src/storeid.rs +++ b/lib/core/libimagstore/src/storeid.rs @@ -31,12 +31,12 @@ use failure::Fallible as Result; use failure::err_msg; use failure::Error; -use store::Store; +use crate::store::Store; -use iter::create::StoreCreateIterator; -use iter::delete::StoreDeleteIterator; -use iter::get::StoreGetIterator; -use iter::retrieve::StoreRetrieveIterator; +use crate::iter::create::StoreCreateIterator; +use crate::iter::delete::StoreDeleteIterator; +use crate::iter::get::StoreGetIterator; +use crate::iter::retrieve::StoreRetrieveIterator; /// The Index into the Store /// @@ -344,14 +344,14 @@ mod test { #[test] fn test_correct_path() { - let p = ::storeid::test::module_path::new_id("test"); + let p = crate::storeid::test::module_path::new_id("test"); assert_eq!(p.unwrap().to_str().unwrap(), "test/test"); } #[test] fn storeid_in_collection() { - let p = ::storeid::test::module_path::new_id("1/2/3/4/5/6/7/8/9/0").unwrap(); + let p = crate::storeid::test::module_path::new_id("1/2/3/4/5/6/7/8/9/0").unwrap(); assert!(p.is_in_collection(&["test", "1"])); assert!(p.is_in_collection(&["test", "1", "2"])); diff --git a/lib/domain/libimagbookmark/src/collection.rs b/lib/domain/libimagbookmark/src/collection.rs index 47f26401..9d2dd1e3 100644 --- a/lib/domain/libimagbookmark/src/collection.rs +++ b/lib/domain/libimagbookmark/src/collection.rs @@ -38,7 +38,7 @@ use libimagentrylink::external::iter::UrlIter; use libimagentrylink::internal::InternalLinker; use libimagentrylink::internal::Link as StoreLink; -use link::Link; +use crate::link::Link; use self::iter::LinksMatchingRegexIter; @@ -51,19 +51,19 @@ pub trait BookmarkCollectionStore<'a> { impl<'a> BookmarkCollectionStore<'a> for Store { fn new(&'a self, name: &str) -> Result> { - ::module_path::new_id(name) + crate::module_path::new_id(name) .and_then(|id| self.create(id).map_err(Error::from)) .map_err(Error::from) } fn get(&'a self, name: &str) -> Result>> { - ::module_path::new_id(name) + crate::module_path::new_id(name) .and_then(|id| self.get(id).map_err(Error::from)) .map_err(Error::from) } fn delete(&'a self, name: &str) -> Result<()> { - ::module_path::new_id(name) + crate::module_path::new_id(name) .and_then(|id| self.delete(id).map_err(Error::from)) .map_err(Error::from) } @@ -90,7 +90,7 @@ impl BookmarkCollection for Entry { } fn add_link(&mut self, store: &Store, l: Link) -> Result> { - use link::IntoUrl; + use crate::link::IntoUrl; l.into_url().and_then(|url| self.add_external_link(store, url)) } @@ -100,14 +100,14 @@ impl BookmarkCollection for Entry { } fn remove_link(&mut self, store: &Store, l: Link) -> Result> { - use link::IntoUrl; + use crate::link::IntoUrl; l.into_url().and_then(|url| self.remove_external_link(store, url)) } } pub mod iter { - use link::Link; + use crate::link::Link; use failure::Fallible as Result; use failure::Error; @@ -167,7 +167,7 @@ pub mod iter { } pub trait IntoLinksMatchingRegexIter<'a> { - fn matching_regex(self, Regex) -> LinksMatchingRegexIter<'a>; + fn matching_regex(self, _: Regex) -> LinksMatchingRegexIter<'a>; } impl<'a> IntoLinksMatchingRegexIter<'a> for UrlIter<'a> { diff --git a/lib/domain/libimagcontact/src/contact.rs b/lib/domain/libimagcontact/src/contact.rs index e5fb8851..89bf630f 100644 --- a/lib/domain/libimagcontact/src/contact.rs +++ b/lib/domain/libimagcontact/src/contact.rs @@ -28,7 +28,7 @@ use libimagentryutil::isa::Is; use libimagentryutil::isa::IsKindHeaderPathProvider; use libimagerror::errors::ErrorMsg as EM; -use deser::DeserVcard; +use crate::deser::DeserVcard; /// Trait to be implemented on ::libimagstore::store::Entry pub trait Contact { diff --git a/lib/domain/libimagcontact/src/iter.rs b/lib/domain/libimagcontact/src/iter.rs index 821ef92b..ea836d55 100644 --- a/lib/domain/libimagcontact/src/iter.rs +++ b/lib/domain/libimagcontact/src/iter.rs @@ -22,7 +22,7 @@ use libimagstore::store::Store; use libimagstore::store::FileLockEntry; use libimagerror::errors::ErrorMsg as EM; -use contact::Contact; +use crate::contact::Contact; use failure::Fallible as Result; use failure::Error; diff --git a/lib/domain/libimagcontact/src/store.rs b/lib/domain/libimagcontact/src/store.rs index eac759ab..351365b4 100644 --- a/lib/domain/libimagcontact/src/store.rs +++ b/lib/domain/libimagcontact/src/store.rs @@ -35,9 +35,9 @@ use libimagstore::store::FileLockEntry; use libimagentryutil::isa::Is; use libimagentryref::reference::{MutRef, Config as RefConfig}; -use contact::IsContact; -use deser::DeserVcard; -use util; +use crate::contact::IsContact; +use crate::deser::DeserVcard; +use crate::util; pub trait ContactStore<'a> { @@ -164,7 +164,7 @@ fn prepare_fetching_from_store(buf: &str) -> Result<(StoreId, Value)> { toml_from_str::(&serialized)? }; - let sid = ::module_path::new_id(uid.raw())?; + let sid = crate::module_path::new_id(uid.raw())?; Ok((sid, value)) } diff --git a/lib/domain/libimagdiary/src/diary.rs b/lib/domain/libimagdiary/src/diary.rs index 8d58c5a1..0c447df5 100644 --- a/lib/domain/libimagdiary/src/diary.rs +++ b/lib/domain/libimagdiary/src/diary.rs @@ -32,11 +32,11 @@ use chrono::Timelike; use failure::Fallible as Result; use failure::Error; -use entry::IsDiaryEntry; -use diaryid::DiaryId; -use diaryid::FromStoreId; -use iter::DiaryEntryIterator; -use iter::DiaryNameIterator; +use crate::entry::IsDiaryEntry; +use crate::diaryid::DiaryId; +use crate::diaryid::FromStoreId; +use crate::iter::DiaryEntryIterator; +use crate::iter::DiaryNameIterator; pub trait Diary { diff --git a/lib/domain/libimagdiary/src/diaryid.rs b/lib/domain/libimagdiary/src/diaryid.rs index 832f39f8..bdf94447 100644 --- a/lib/domain/libimagdiary/src/diaryid.rs +++ b/lib/domain/libimagdiary/src/diaryid.rs @@ -150,7 +150,7 @@ impl IntoStoreId for DiaryId { fn into_storeid(self) -> Result { use std::path::PathBuf; let s : String = self.into(); - ::module_path::new_id(PathBuf::from(s)) + crate::module_path::new_id(PathBuf::from(s)) } } @@ -184,7 +184,7 @@ impl Into for DiaryId { } pub trait FromStoreId : Sized { - fn from_storeid(&StoreId) -> Result; + fn from_storeid(_: &StoreId) -> Result; } use std::path::Component; diff --git a/lib/domain/libimagdiary/src/entry.rs b/lib/domain/libimagdiary/src/entry.rs index 7f3ed76e..9235f426 100644 --- a/lib/domain/libimagdiary/src/entry.rs +++ b/lib/domain/libimagdiary/src/entry.rs @@ -23,8 +23,8 @@ use libimagentryutil::isa::IsKindHeaderPathProvider; use failure::Fallible as Result; -use diaryid::DiaryId; -use diaryid::FromStoreId; +use crate::diaryid::DiaryId; +use crate::diaryid::FromStoreId; provide_kindflag_path!(pub IsDiaryEntry, "diary.is_diary_entry"); diff --git a/lib/domain/libimagdiary/src/iter.rs b/lib/domain/libimagdiary/src/iter.rs index 70449f2e..147aaf60 100644 --- a/lib/domain/libimagdiary/src/iter.rs +++ b/lib/domain/libimagdiary/src/iter.rs @@ -25,7 +25,7 @@ use filters::filter::Filter; use libimagstore::storeid::StoreIdIterator; use libimagstore::storeid::StoreId; -use is_in_diary::IsInDiary; +use crate::is_in_diary::IsInDiary; use failure::Fallible as Result; use failure::Error; use failure::err_msg; diff --git a/lib/domain/libimagdiary/src/viewer.rs b/lib/domain/libimagdiary/src/viewer.rs index 5371787f..7b5e6991 100644 --- a/lib/domain/libimagdiary/src/viewer.rs +++ b/lib/domain/libimagdiary/src/viewer.rs @@ -30,7 +30,7 @@ use failure::Error; use libimagstore::store::Entry; use libimagentryview::viewer::Viewer; use libimagentryview::builtin::plain::PlainViewer; -use entry::DiaryEntry; +use crate::entry::DiaryEntry; /// This viewer does _not_ implement libimagentryview::viewer::Viewer because we need to be able to /// call some diary-type specific functions on the entries passed to this. diff --git a/lib/domain/libimaghabit/src/habit.rs b/lib/domain/libimaghabit/src/habit.rs index 2fcc33fd..2e99a443 100644 --- a/lib/domain/libimaghabit/src/habit.rs +++ b/lib/domain/libimaghabit/src/habit.rs @@ -27,10 +27,10 @@ use failure::Error; use failure::Fallible as Result; use failure::err_msg; -use iter::HabitInstanceStoreIdIterator; -use util::IsHabitCheck; -use util::get_string_header_from_entry; -use instance::IsHabitInstance; +use crate::iter::HabitInstanceStoreIdIterator; +use crate::util::IsHabitCheck; +use crate::util::get_string_header_from_entry; +use crate::instance::IsHabitInstance; use libimagentrylink::internal::InternalLinker; use libimagstore::store::Store; @@ -161,7 +161,7 @@ impl HabitTemplate for Entry { debug!("Increment is {:?}", increment); let until = self.habit_until_date()?.map(|s| -> Result<_> { - try!(date_from_s(s)) + r#try!(date_from_s(s)) .calculate()? .get_moment() .map(Clone::clone) @@ -257,7 +257,7 @@ impl HabitTemplate for Entry { } fn instance_id_for_name_and_datestr(habit_name: &String, habit_date: &String) -> Result { - ::module_path::new_id(format!("instance/{}-{}", habit_name, habit_date)).map_err(Error::from) + crate::module_path::new_id(format!("instance/{}-{}", habit_name, habit_date)).map_err(Error::from) } pub mod builder { @@ -276,7 +276,7 @@ pub mod builder { use failure::err_msg; use libimagutil::date::date_to_string; - use habit::IsHabitTemplate; + use crate::habit::IsHabitTemplate; #[derive(Debug)] pub struct HabitBuilder { @@ -348,10 +348,10 @@ pub mod builder { debug!("Success: Date valid"); let comment = self.comment.unwrap_or_else(|| String::new()); - let sid = try!(build_habit_template_sid(&name)); + let sid = r#try!(build_habit_template_sid(&name)); debug!("Creating entry in store for: {:?}", sid); - let mut entry = try!(store.create(sid)); + let mut entry = r#try!(store.create(sid)); let _ = entry.set_isflag::()?; { @@ -364,7 +364,7 @@ pub mod builder { if let Some(until) = self.untildate { let until = date_to_string(&until); - try!(entry.get_header_mut().insert("habit.template.until", Value::String(until))); + r#try!(entry.get_header_mut().insert("habit.template.until", Value::String(until))); } debug!("Success: Created entry in store and set headers"); @@ -387,7 +387,7 @@ pub mod builder { /// Buld a StoreId for a Habit from a date object and a name of a habit fn build_habit_template_sid(name: &String) -> Result { - ::module_path::new_id(format!("template/{}", name)).map_err(From::from) + crate::module_path::new_id(format!("template/{}", name)).map_err(From::from) } } diff --git a/lib/domain/libimaghabit/src/instance.rs b/lib/domain/libimaghabit/src/instance.rs index 95e139c1..2255afdf 100644 --- a/lib/domain/libimaghabit/src/instance.rs +++ b/lib/domain/libimaghabit/src/instance.rs @@ -22,7 +22,7 @@ use toml::Value; use toml_query::set::TomlValueSetExt; use failure::Fallible as Result; -use util::*; +use crate::util::*; use libimagstore::store::Entry; use libimagentryutil::isa::Is; diff --git a/lib/domain/libimaghabit/src/iter.rs b/lib/domain/libimaghabit/src/iter.rs index 8cdb7c70..f58dbd56 100644 --- a/lib/domain/libimaghabit/src/iter.rs +++ b/lib/domain/libimaghabit/src/iter.rs @@ -24,7 +24,7 @@ use libimagstore::storeid::StoreIdIterator; use libimagstore::storeid::StoreIdIteratorWithStore; use libimagstore::storeid::StoreId; -use util::IsHabitCheck; +use crate::util::IsHabitCheck; pub struct HabitTemplateStoreIdIterator(StoreIdIterator); diff --git a/lib/domain/libimaghabit/src/store.rs b/lib/domain/libimaghabit/src/store.rs index 5fbcf0cd..ced874d1 100644 --- a/lib/domain/libimaghabit/src/store.rs +++ b/lib/domain/libimaghabit/src/store.rs @@ -19,9 +19,9 @@ use failure::Fallible as Result; -use habit::builder::HabitBuilder; -use iter::HabitTemplateStoreIdIterator; -use iter::HabitInstanceStoreIdIterator; +use crate::habit::builder::HabitBuilder; +use crate::iter::HabitTemplateStoreIdIterator; +use crate::iter::HabitInstanceStoreIdIterator; use libimagstore::store::Store; diff --git a/lib/domain/libimaghabit/src/util.rs b/lib/domain/libimaghabit/src/util.rs index 37d4f2bb..51adb6c1 100644 --- a/lib/domain/libimaghabit/src/util.rs +++ b/lib/domain/libimaghabit/src/util.rs @@ -22,8 +22,8 @@ use std::ops::BitXor; use failure::Error; use failure::Fallible as Result; -use habit::HabitTemplate; -use instance::HabitInstance; +use crate::habit::HabitTemplate; +use crate::instance::HabitInstance; use libimagstore::storeid::StoreId; use libimagstore::store::Entry; diff --git a/lib/domain/libimagmail/src/hasher.rs b/lib/domain/libimagmail/src/hasher.rs index 3d6dd590..fdaf78b6 100644 --- a/lib/domain/libimagmail/src/hasher.rs +++ b/lib/domain/libimagmail/src/hasher.rs @@ -46,7 +46,7 @@ impl Hasher for MailHasher { .map(String::from) .ok_or_else(|| ErrorMsg::UTF8Error)?; - let message_id = ::util::get_message_id_for_mailfile(path)?; + let message_id = crate::util::get_message_id_for_mailfile(path)?; path_str.push_str(&message_id); diff --git a/lib/domain/libimagmail/src/mail.rs b/lib/domain/libimagmail/src/mail.rs index b6429446..fca352b7 100644 --- a/lib/domain/libimagmail/src/mail.rs +++ b/lib/domain/libimagmail/src/mail.rs @@ -48,7 +48,7 @@ impl Mail for Entry { /// Get a value of a single field of the mail file fn get_field(&self, refconfig: &RefConfig, field: &str) -> Result> { use std::fs::read_to_string; - use hasher::MailHasher; + use crate::hasher::MailHasher; debug!("Getting field in mail: {:?}", field); let mail_file_location = self.as_ref_with_hasher::().get_path(refconfig)?; @@ -107,7 +107,7 @@ impl Mail for Entry { /// Use `Mail::mail_header()` if you need to read more than one field. fn get_message_id(&self, refconfig: &RefConfig) -> Result> { self.get_field(refconfig, "Message-ID") - .map(|o| o.map(::util::strip_message_delimiters)) + .map(|o| o.map(crate::util::strip_message_delimiters)) } /// Get a value of the `In-Reply-To` field of the mail file diff --git a/lib/domain/libimagmail/src/store.rs b/lib/domain/libimagmail/src/store.rs index 3355a2c9..851c4d4f 100644 --- a/lib/domain/libimagmail/src/store.rs +++ b/lib/domain/libimagmail/src/store.rs @@ -35,10 +35,10 @@ use libimagentryref::reference::RefFassade; use libimagentryref::reference::Ref; use libimagentryref::reference::MutRef; -use mid::MessageId; -use mail::Mail; -use hasher::MailHasher; -use util::get_message_id_for_mailfile; +use crate::mid::MessageId; +use crate::mail::Mail; +use crate::hasher::MailHasher; +use crate::util::get_message_id_for_mailfile; pub trait MailStore<'a> { fn create_mail_from_path(&'a self, p: P, collection_name: CollName, config: &Config) @@ -67,7 +67,7 @@ impl<'a> MailStore<'a> for Store { CollName: AsRef + Debug { let message_id = get_message_id_for_mailfile(p.as_ref())?; - let new_sid = ::module_path::new_id(message_id.clone())?; + let new_sid = crate::module_path::new_id(message_id.clone())?; let mut entry = self.create(new_sid)?; let _ = entry @@ -88,7 +88,7 @@ impl<'a> MailStore<'a> for Store { where P: AsRef + Debug { let message_id = get_message_id_for_mailfile(p.as_ref())?; - let new_sid = ::module_path::new_id(message_id.clone())?; + let new_sid = crate::module_path::new_id(message_id.clone())?; match self.get(new_sid)? { Some(mut entry) => { @@ -115,7 +115,7 @@ impl<'a> MailStore<'a> for Store { CollName: AsRef + Debug { let message_id = get_message_id_for_mailfile(&p)?; - let new_sid = ::module_path::new_id(message_id.clone())?; + let new_sid = crate::module_path::new_id(message_id.clone())?; let mut entry = self.retrieve(new_sid)?; let _ = entry diff --git a/lib/domain/libimagnotes/src/iter.rs b/lib/domain/libimagnotes/src/iter.rs index 6753894f..74908c8f 100644 --- a/lib/domain/libimagnotes/src/iter.rs +++ b/lib/domain/libimagnotes/src/iter.rs @@ -20,7 +20,7 @@ use libimagstore::storeid::StoreId; use libimagstore::storeid::StoreIdIterator; -use notestoreid::*; +use crate::notestoreid::*; use failure::Fallible as Result; use failure::Error; diff --git a/lib/domain/libimagnotes/src/notestore.rs b/lib/domain/libimagnotes/src/notestore.rs index 4245bce1..27bd5aad 100644 --- a/lib/domain/libimagnotes/src/notestore.rs +++ b/lib/domain/libimagnotes/src/notestore.rs @@ -25,7 +25,7 @@ use libimagstore::store::Store; use toml_query::insert::TomlValueInsertExt; use failure::Fallible as Result; -use iter::*; +use crate::iter::*; pub trait NoteStore<'a> { fn new_note(&'a self, name: String, text: String) -> Result>; @@ -43,7 +43,7 @@ impl<'a> NoteStore<'a> for Store { debug!("Creating new Note: '{}'", name); let fle = { - let mut lockentry = ::module_path::new_id(name.clone()).and_then(|id| self.create(id))?; + let mut lockentry = crate::module_path::new_id(name.clone()).and_then(|id| self.create(id))?; { let entry = lockentry.deref_mut(); @@ -58,15 +58,15 @@ impl<'a> NoteStore<'a> for Store { } fn delete_note(&'a self, name: String) -> Result<()> { - ::module_path::new_id(name).and_then(|id| self.delete(id)) + crate::module_path::new_id(name).and_then(|id| self.delete(id)) } fn retrieve_note(&'a self, name: String) -> Result> { - ::module_path::new_id(name).and_then(|id| self.retrieve(id)) + crate::module_path::new_id(name).and_then(|id| self.retrieve(id)) } fn get_note(&'a self, name: String) -> Result>> { - ::module_path::new_id(name).and_then(|id| self.get(id)) + crate::module_path::new_id(name).and_then(|id| self.get(id)) } fn all_notes(&'a self) -> Result { diff --git a/lib/domain/libimagtimetrack/src/iter/create.rs b/lib/domain/libimagtimetrack/src/iter/create.rs index 5d9e4d4f..82519036 100644 --- a/lib/domain/libimagtimetrack/src/iter/create.rs +++ b/lib/domain/libimagtimetrack/src/iter/create.rs @@ -23,9 +23,9 @@ use chrono::naive::NaiveDateTime as NDT; use failure::Fallible as Result; use failure::Error; -use constants::*; -use iter::storeid::TagStoreIdIter; -use iter::setendtime::SetEndTimeIter; +use crate::constants::*; +use crate::iter::storeid::TagStoreIdIter; +use crate::iter::setendtime::SetEndTimeIter; use libimagstore::store::FileLockEntry; use libimagstore::store::Store; diff --git a/lib/domain/libimagtimetrack/src/iter/filter.rs b/lib/domain/libimagtimetrack/src/iter/filter.rs index f4413c9f..b0114c33 100644 --- a/lib/domain/libimagtimetrack/src/iter/filter.rs +++ b/lib/domain/libimagtimetrack/src/iter/filter.rs @@ -21,8 +21,8 @@ use chrono::NaiveDateTime; use libimagstore::store::FileLockEntry; -use tag::TimeTrackingTag as TTT; -use timetracking::TimeTracking; +use crate::tag::TimeTrackingTag as TTT; +use crate::timetracking::TimeTracking; pub fn has_start_time(entry: &FileLockEntry) -> bool { @@ -57,8 +57,8 @@ mod types { use chrono::NaiveDateTime; use filters::filter::Filter; - use tag::TimeTrackingTag as TTT; - use timetracking::TimeTracking; + use crate::tag::TimeTrackingTag as TTT; + use crate::timetracking::TimeTracking; use libimagstore::store::FileLockEntry; diff --git a/lib/domain/libimagtimetrack/src/iter/get.rs b/lib/domain/libimagtimetrack/src/iter/get.rs index 186fb949..93adfcd5 100644 --- a/lib/domain/libimagtimetrack/src/iter/get.rs +++ b/lib/domain/libimagtimetrack/src/iter/get.rs @@ -23,7 +23,7 @@ use libimagstore::store::FileLockEntry; use failure::Fallible as Result; -use constants::*; +use crate::constants::*; pub struct TimeTrackingsGetIterator<'a>(Entries<'a>, &'a Store); diff --git a/lib/domain/libimagtimetrack/src/iter/setendtime.rs b/lib/domain/libimagtimetrack/src/iter/setendtime.rs index aee8ffa4..838b8db5 100644 --- a/lib/domain/libimagtimetrack/src/iter/setendtime.rs +++ b/lib/domain/libimagtimetrack/src/iter/setendtime.rs @@ -22,8 +22,8 @@ use toml_query::insert::TomlValueInsertExt; use chrono::naive::NaiveDateTime as NDT; use failure::Fallible as Result; -use constants::*; -use iter::create::CreateTimeTrackIter; +use crate::constants::*; +use crate::iter::create::CreateTimeTrackIter; use libimagstore::store::FileLockEntry; diff --git a/lib/domain/libimagtimetrack/src/iter/storeid.rs b/lib/domain/libimagtimetrack/src/iter/storeid.rs index 2e2a0473..0c747a63 100644 --- a/lib/domain/libimagtimetrack/src/iter/storeid.rs +++ b/lib/domain/libimagtimetrack/src/iter/storeid.rs @@ -21,9 +21,9 @@ use chrono::naive::NaiveDateTime as NDT; use failure::Fallible as Result; use failure::Error; -use constants::*; -use iter::tag::TagIter; -use iter::create::CreateTimeTrackIter; +use crate::constants::*; +use crate::iter::tag::TagIter; +use crate::iter::create::CreateTimeTrackIter; use libimagstore::store::Store; use libimagstore::storeid::StoreId; @@ -54,7 +54,7 @@ impl Iterator for TagStoreIdIter { .map(|res| res.and_then(|tag| { let dt = self.datetime.format(DATE_TIME_FORMAT).to_string(); let id_str = format!("{}-{}", dt, tag.as_str()); - ::module_path::new_id(id_str) + crate::module_path::new_id(id_str) .map_err(Error::from) .map(|id| (id, self.datetime.clone())) })) diff --git a/lib/domain/libimagtimetrack/src/iter/tag.rs b/lib/domain/libimagtimetrack/src/iter/tag.rs index fcc4a220..696d9824 100644 --- a/lib/domain/libimagtimetrack/src/iter/tag.rs +++ b/lib/domain/libimagtimetrack/src/iter/tag.rs @@ -22,8 +22,8 @@ use failure::Fallible as Result; use failure::Error; use failure::err_msg; -use tag::TimeTrackingTag as TTT; -use iter::storeid::TagStoreIdIter; +use crate::tag::TimeTrackingTag as TTT; +use crate::iter::storeid::TagStoreIdIter; use libimagentrytag::tag::is_tag_str; diff --git a/lib/domain/libimagtimetrack/src/timetracking.rs b/lib/domain/libimagtimetrack/src/timetracking.rs index 337afc3a..045725f2 100644 --- a/lib/domain/libimagtimetrack/src/timetracking.rs +++ b/lib/domain/libimagtimetrack/src/timetracking.rs @@ -29,8 +29,8 @@ use chrono::naive::NaiveDateTime; use libimagstore::store::Entry; use libimagerror::errors::ErrorMsg as EM; -use tag::TimeTrackingTag as TTT; -use constants::*; +use crate::tag::TimeTrackingTag as TTT; +use crate::constants::*; use toml::Value; use toml_query::delete::TomlValueDeleteExt; diff --git a/lib/domain/libimagtimetrack/src/timetrackingstore.rs b/lib/domain/libimagtimetrack/src/timetrackingstore.rs index 50339c27..2144185b 100644 --- a/lib/domain/libimagtimetrack/src/timetrackingstore.rs +++ b/lib/domain/libimagtimetrack/src/timetrackingstore.rs @@ -32,10 +32,10 @@ use libimagstore::store::Store; use libimagstore::store::FileLockEntry; use libimagentrydatetime::datepath::compiler::DatePathCompiler; -use constants::*; -use iter::get::TimeTrackingsGetIterator; +use crate::constants::*; +use crate::iter::get::TimeTrackingsGetIterator; -use tag::TimeTrackingTag as TTT; +use crate::tag::TimeTrackingTag as TTT; pub trait TimeTrackStore<'a> { diff --git a/lib/domain/libimagtodo/src/taskstore.rs b/lib/domain/libimagtodo/src/taskstore.rs index bbd2ae77..c0e1cdc4 100644 --- a/lib/domain/libimagtodo/src/taskstore.rs +++ b/lib/domain/libimagtodo/src/taskstore.rs @@ -34,7 +34,7 @@ use failure::err_msg; use libimagstore::store::{FileLockEntry, Store}; use libimagerror::errors::ErrorMsg as EM; -use iter::TaskIdIterator; +use crate::iter::TaskIdIterator; /// Task struct containing a `FileLockEntry` pub trait TaskStore<'a> { @@ -99,7 +99,7 @@ impl<'a> TaskStore<'a> for Store { /// /// If there is no task with this UUID, this returns `Ok(None)`. fn get_task_from_uuid(&'a self, uuid: Uuid) -> Result>> { - ::module_path::new_id(format!("taskwarrior/{}", uuid)).and_then(|store_id| self.get(store_id)) + crate::module_path::new_id(format!("taskwarrior/{}", uuid)).and_then(|store_id| self.get(store_id)) } /// Same as Task::get_from_import() but uses Store::retrieve() rather than Store::get(), to @@ -150,7 +150,7 @@ impl<'a> TaskStore<'a> for Store { } fn delete_task_by_uuid(&self, uuid: Uuid) -> Result<()> { - ::module_path::new_id(format!("taskwarrior/{}", uuid)).and_then(|id| self.delete(id)) + crate::module_path::new_id(format!("taskwarrior/{}", uuid)).and_then(|id| self.delete(id)) } fn all_tasks(&self) -> Result { @@ -162,7 +162,7 @@ impl<'a> TaskStore<'a> for Store { use toml_query::set::TomlValueSetExt; let uuid = task.uuid(); - ::module_path::new_id(format!("taskwarrior/{}", uuid)).and_then(|id| { + crate::module_path::new_id(format!("taskwarrior/{}", uuid)).and_then(|id| { self.retrieve(id).and_then(|mut fle| { { let hdr = fle.get_header_mut(); diff --git a/lib/domain/libimagwiki/src/store.rs b/lib/domain/libimagwiki/src/store.rs index a1e93e8a..165e03a2 100644 --- a/lib/domain/libimagwiki/src/store.rs +++ b/lib/domain/libimagwiki/src/store.rs @@ -23,7 +23,7 @@ use libimagstore::storeid::StoreId; use failure::Fallible as Result; -use wiki::Wiki; +use crate::wiki::Wiki; pub trait WikiStore { @@ -82,6 +82,6 @@ impl WikiStore for Store { } fn wiki_path(name: &str) -> Result { - ::module_path::new_id(name) + crate::module_path::new_id(name) } diff --git a/lib/domain/libimagwiki/src/wiki.rs b/lib/domain/libimagwiki/src/wiki.rs index 195f46e2..6e88a760 100644 --- a/lib/domain/libimagwiki/src/wiki.rs +++ b/lib/domain/libimagwiki/src/wiki.rs @@ -47,14 +47,14 @@ impl<'a, 'b> Wiki<'a, 'b> { pub(crate) fn create_index_page(&self) -> Result> { let path = PathBuf::from(format!("{}/index", self.1)); - let sid = ::module_path::new_id(path)?; + let sid = crate::module_path::new_id(path)?; self.0.create(sid) } pub(crate) fn get_index_page(&self) -> Result> { let path = PathBuf::from(format!("{}/index", self.1)); - let sid = ::module_path::new_id(path)?; + let sid = crate::module_path::new_id(path)?; self.0 .get(sid) @@ -64,13 +64,13 @@ impl<'a, 'b> Wiki<'a, 'b> { pub fn get_entry>(&self, entry_name: EN) -> Result>> { let path = PathBuf::from(format!("{}/{}", self.1, entry_name.as_ref())); - let sid = ::module_path::new_id(path)?; + let sid = crate::module_path::new_id(path)?; self.0.get(sid) } pub fn create_entry>(&self, entry_name: EN) -> Result> { let path = PathBuf::from(format!("{}/{}", self.1, entry_name.as_ref())); - let sid = ::module_path::new_id(path)?; + let sid = crate::module_path::new_id(path)?; let mut index = self .get_entry("index")? .ok_or_else(|| err_msg("Missing index page"))?; @@ -81,7 +81,7 @@ impl<'a, 'b> Wiki<'a, 'b> { pub fn retrieve_entry>(&self, entry_name: EN) -> Result> { let path = PathBuf::from(format!("{}/{}", self.1, entry_name.as_ref())); - let sid = ::module_path::new_id(path)?; + let sid = crate::module_path::new_id(path)?; let mut index = self .get_entry("index")? .ok_or_else(|| err_msg("Missing index page"))?; @@ -96,7 +96,7 @@ impl<'a, 'b> Wiki<'a, 'b> { pub fn delete_entry>(&self, entry_name: EN) -> Result<()> { let path = PathBuf::from(format!("{}/{}", self.1, entry_name.as_ref())); - let sid = ::module_path::new_id(path)?; + let sid = crate::module_path::new_id(path)?; self.0.delete(sid) } } diff --git a/lib/entry/libimagentryannotation/src/annotateable.rs b/lib/entry/libimagentryannotation/src/annotateable.rs index 19138e73..46b8cdbc 100644 --- a/lib/entry/libimagentryannotation/src/annotateable.rs +++ b/lib/entry/libimagentryannotation/src/annotateable.rs @@ -51,7 +51,7 @@ impl Annotateable for Entry { let ann_name = Uuid::new_v4().to_hyphenated().to_string(); debug!("Creating annotation with name = {}", ann_name); - store.retrieve(::module_path::new_id(ann_name.clone())?) + store.retrieve(crate::module_path::new_id(ann_name.clone())?) .and_then(|mut anno| { { let _ = anno.set_isflag::()?; @@ -73,7 +73,7 @@ impl Annotateable for Entry { // Fails if there's no such annotation entry or if the link to that annotation entry does not // exist. fn denotate<'a>(&mut self, store: &'a Store, ann_name: &str) -> Result>> { - if let Some(mut annotation) = store.get(::module_path::new_id(ann_name)?)? { + if let Some(mut annotation) = store.get(crate::module_path::new_id(ann_name)?)? { let _ = self.remove_internal_link(&mut annotation)?; Ok(Some(annotation)) } else { diff --git a/lib/entry/libimagentrycategory/src/category.rs b/lib/entry/libimagentrycategory/src/category.rs index c7b3b9f7..de81bfbd 100644 --- a/lib/entry/libimagentrycategory/src/category.rs +++ b/lib/entry/libimagentrycategory/src/category.rs @@ -29,8 +29,8 @@ use toml_query::read::TomlValueReadTypeExt; use failure::Fallible as Result; use failure::Error; use failure::err_msg; -use store::CATEGORY_REGISTER_NAME_FIELD_PATH; -use iter::CategoryEntryIterator; +use crate::store::CATEGORY_REGISTER_NAME_FIELD_PATH; +use crate::iter::CategoryEntryIterator; provide_kindflag_path!(pub IsCategory, "category.is_category"); diff --git a/lib/entry/libimagentrycategory/src/entry.rs b/lib/entry/libimagentrycategory/src/entry.rs index 5301fcfb..8260de8a 100644 --- a/lib/entry/libimagentrycategory/src/entry.rs +++ b/lib/entry/libimagentrycategory/src/entry.rs @@ -30,7 +30,7 @@ use failure::Fallible as Result; use failure::ResultExt; use failure::Error; use failure::err_msg; -use store::CategoryStore; +use crate::store::CategoryStore; pub trait EntryCategory { diff --git a/lib/entry/libimagentrycategory/src/iter.rs b/lib/entry/libimagentrycategory/src/iter.rs index 30d13c02..a16f0b9b 100644 --- a/lib/entry/libimagentrycategory/src/iter.rs +++ b/lib/entry/libimagentrycategory/src/iter.rs @@ -28,8 +28,8 @@ use failure::Fallible as Result; use failure::ResultExt; use failure::Error; use failure::err_msg; -use store::CATEGORY_REGISTER_NAME_FIELD_PATH; -use entry::EntryCategory; +use crate::store::CATEGORY_REGISTER_NAME_FIELD_PATH; +use crate::entry::EntryCategory; /// Iterator for Category names /// diff --git a/lib/entry/libimagentrycategory/src/store.rs b/lib/entry/libimagentrycategory/src/store.rs index 508b3e8d..3ea78648 100644 --- a/lib/entry/libimagentrycategory/src/store.rs +++ b/lib/entry/libimagentrycategory/src/store.rs @@ -31,8 +31,8 @@ use failure::Fallible as Result; use failure::ResultExt; use failure::Error; use failure::err_msg; -use iter::CategoryNameIter; -use category::IsCategory; +use crate::iter::CategoryNameIter; +use crate::category::IsCategory; pub const CATEGORY_REGISTER_NAME_FIELD_PATH : &'static str = "category.register.name"; @@ -85,7 +85,7 @@ impl CategoryStore for Store { /// Automatically removes all category settings from entries which are linked to this category. fn delete_category(&self, name: &str) -> Result<()> { use libimagentrylink::internal::InternalLinker; - use category::Category; + use crate::category::Category; trace!("Deleting category: '{}'", name); let sid = mk_category_storeid(name)?; @@ -208,7 +208,7 @@ mod tests { #[inline] fn mk_category_storeid(s: &str) -> Result { - ::module_path::new_id(s).context(err_msg("Store id handling error")).map_err(Error::from) + crate::module_path::new_id(s).context(err_msg("Store id handling error")).map_err(Error::from) } #[inline] diff --git a/lib/entry/libimagentrydatetime/src/datepath/compiler.rs b/lib/entry/libimagentrydatetime/src/datepath/compiler.rs index d7515d16..1f06f5ec 100644 --- a/lib/entry/libimagentrydatetime/src/datepath/compiler.rs +++ b/lib/entry/libimagentrydatetime/src/datepath/compiler.rs @@ -25,8 +25,8 @@ use chrono::Timelike; use libimagstore::storeid::StoreId; -use datepath::accuracy::Accuracy; -use datepath::format::Format; +use crate::datepath::accuracy::Accuracy; +use crate::datepath::format::Format; use failure::Fallible as Result; pub struct DatePathCompiler { @@ -127,8 +127,8 @@ impl DatePathCompiler { #[cfg(test)] mod test { use super::*; - use datepath::accuracy::Accuracy; - use datepath::format::Format; + use crate::datepath::accuracy::Accuracy; + use crate::datepath::format::Format; use chrono::naive::NaiveDate; use chrono::naive::NaiveDateTime; diff --git a/lib/entry/libimagentrydatetime/src/datepath/to_store_id.rs b/lib/entry/libimagentrydatetime/src/datepath/to_store_id.rs index 225c0096..c17da510 100644 --- a/lib/entry/libimagentrydatetime/src/datepath/to_store_id.rs +++ b/lib/entry/libimagentrydatetime/src/datepath/to_store_id.rs @@ -21,7 +21,7 @@ use chrono::naive::NaiveDateTime; use failure::Fallible as Result; use libimagstore::storeid::StoreId; -use datepath::compiler::DatePathCompiler; +use crate::datepath::compiler::DatePathCompiler; // // Extension Trait for NaiveDateTime diff --git a/lib/entry/libimagentrydatetime/src/datetime.rs b/lib/entry/libimagentrydatetime/src/datetime.rs index acfa26c5..611e5dbd 100644 --- a/lib/entry/libimagentrydatetime/src/datetime.rs +++ b/lib/entry/libimagentrydatetime/src/datetime.rs @@ -30,7 +30,7 @@ use failure::Error; use failure::Fallible as Result; use failure::ResultExt; use failure::err_msg; -use range::DateTimeRange; +use crate::range::DateTimeRange; pub trait EntryDate { diff --git a/lib/entry/libimagentryfilter/src/builtin/header/field_eq.rs b/lib/entry/libimagentryfilter/src/builtin/header/field_eq.rs index caa6dda5..3309181b 100644 --- a/lib/entry/libimagentryfilter/src/builtin/header/field_eq.rs +++ b/lib/entry/libimagentryfilter/src/builtin/header/field_eq.rs @@ -19,9 +19,9 @@ use libimagstore::store::Entry; -use builtin::header::field_path::FieldPath; -use builtin::header::field_predicate::FieldPredicate; -use builtin::header::field_predicate::Predicate; +use crate::builtin::header::field_path::FieldPath; +use crate::builtin::header::field_predicate::FieldPredicate; +use crate::builtin::header::field_predicate::Predicate; use filters::failable::filter::FailableFilter; use failure::Fallible as Result; diff --git a/lib/entry/libimagentryfilter/src/builtin/header/field_exists.rs b/lib/entry/libimagentryfilter/src/builtin/header/field_exists.rs index 08994d1f..be816c8a 100644 --- a/lib/entry/libimagentryfilter/src/builtin/header/field_exists.rs +++ b/lib/entry/libimagentryfilter/src/builtin/header/field_exists.rs @@ -25,7 +25,7 @@ use filters::failable::filter::FailableFilter; use failure::Fallible as Result; use failure::Error; -use builtin::header::field_path::FieldPath; +use crate::builtin::header::field_path::FieldPath; pub struct FieldExists { header_field_path: FieldPath, diff --git a/lib/entry/libimagentryfilter/src/builtin/header/field_grep.rs b/lib/entry/libimagentryfilter/src/builtin/header/field_grep.rs index 96594eff..feb7df47 100644 --- a/lib/entry/libimagentryfilter/src/builtin/header/field_grep.rs +++ b/lib/entry/libimagentryfilter/src/builtin/header/field_grep.rs @@ -22,9 +22,9 @@ use toml::Value; use libimagstore::store::Entry; -use builtin::header::field_path::FieldPath; -use builtin::header::field_predicate::FieldPredicate; -use builtin::header::field_predicate::Predicate; +use crate::builtin::header::field_path::FieldPath; +use crate::builtin::header::field_predicate::FieldPredicate; +use crate::builtin::header::field_predicate::Predicate; use filters::failable::filter::FailableFilter; use failure::Fallible as Result; diff --git a/lib/entry/libimagentryfilter/src/builtin/header/field_gt.rs b/lib/entry/libimagentryfilter/src/builtin/header/field_gt.rs index 7709db37..4b432224 100644 --- a/lib/entry/libimagentryfilter/src/builtin/header/field_gt.rs +++ b/lib/entry/libimagentryfilter/src/builtin/header/field_gt.rs @@ -19,9 +19,9 @@ use libimagstore::store::Entry; -use builtin::header::field_path::FieldPath; -use builtin::header::field_predicate::FieldPredicate; -use builtin::header::field_predicate::Predicate; +use crate::builtin::header::field_path::FieldPath; +use crate::builtin::header::field_predicate::FieldPredicate; +use crate::builtin::header::field_predicate::Predicate; use filters::failable::filter::FailableFilter; use failure::Fallible as Result; diff --git a/lib/entry/libimagentryfilter/src/builtin/header/field_isempty.rs b/lib/entry/libimagentryfilter/src/builtin/header/field_isempty.rs index b420c907..f3378310 100644 --- a/lib/entry/libimagentryfilter/src/builtin/header/field_isempty.rs +++ b/lib/entry/libimagentryfilter/src/builtin/header/field_isempty.rs @@ -20,7 +20,7 @@ use libimagstore::store::Entry; use toml_query::read::TomlValueReadExt; -use builtin::header::field_path::FieldPath; +use crate::builtin::header::field_path::FieldPath; use filters::failable::filter::FailableFilter; use failure::Fallible as Result; diff --git a/lib/entry/libimagentryfilter/src/builtin/header/field_istype.rs b/lib/entry/libimagentryfilter/src/builtin/header/field_istype.rs index 665f764d..960ef610 100644 --- a/lib/entry/libimagentryfilter/src/builtin/header/field_istype.rs +++ b/lib/entry/libimagentryfilter/src/builtin/header/field_istype.rs @@ -19,9 +19,9 @@ use libimagstore::store::Entry; -use builtin::header::field_path::FieldPath; -use builtin::header::field_predicate::FieldPredicate; -use builtin::header::field_predicate::Predicate; +use crate::builtin::header::field_path::FieldPath; +use crate::builtin::header::field_predicate::FieldPredicate; +use crate::builtin::header::field_predicate::Predicate; use filters::failable::filter::FailableFilter; use failure::Fallible as Result; diff --git a/lib/entry/libimagentryfilter/src/builtin/header/field_lt.rs b/lib/entry/libimagentryfilter/src/builtin/header/field_lt.rs index a41c789c..682b8999 100644 --- a/lib/entry/libimagentryfilter/src/builtin/header/field_lt.rs +++ b/lib/entry/libimagentryfilter/src/builtin/header/field_lt.rs @@ -19,9 +19,9 @@ use libimagstore::store::Entry; -use builtin::header::field_path::FieldPath; -use builtin::header::field_predicate::FieldPredicate; -use builtin::header::field_predicate::Predicate; +use crate::builtin::header::field_path::FieldPath; +use crate::builtin::header::field_predicate::FieldPredicate; +use crate::builtin::header::field_predicate::Predicate; use filters::failable::filter::FailableFilter; use failure::Fallible as Result; diff --git a/lib/entry/libimagentryfilter/src/builtin/header/field_predicate.rs b/lib/entry/libimagentryfilter/src/builtin/header/field_predicate.rs index a2a4ccb6..abd08f9c 100644 --- a/lib/entry/libimagentryfilter/src/builtin/header/field_predicate.rs +++ b/lib/entry/libimagentryfilter/src/builtin/header/field_predicate.rs @@ -22,14 +22,14 @@ use libimagstore::store::Entry; use toml_query::read::TomlValueReadExt; use toml::Value; -use builtin::header::field_path::FieldPath; +use crate::builtin::header::field_path::FieldPath; use filters::failable::filter::FailableFilter; use failure::Fallible as Result; use failure::Error; pub trait Predicate { - fn evaluate(&self, &Value) -> bool; + fn evaluate(&self, _: &Value) -> bool; } /// Check whether certain header field in a entry is equal to a value diff --git a/lib/entry/libimagentryfilter/src/builtin/header/version/range.rs b/lib/entry/libimagentryfilter/src/builtin/header/version/range.rs index b85687ac..8a7b55ea 100644 --- a/lib/entry/libimagentryfilter/src/builtin/header/version/range.rs +++ b/lib/entry/libimagentryfilter/src/builtin/header/version/range.rs @@ -21,8 +21,8 @@ use semver::Version; use libimagstore::store::Entry; -use builtin::header::version::gt::VersionGt; -use builtin::header::version::lt::VersionLt; +use crate::builtin::header::version::gt::VersionGt; +use crate::builtin::header::version::lt::VersionLt; use filters::filter::Filter; use filters::ops::and::And; use filters::ops::not::Not; diff --git a/lib/entry/libimagentrygps/src/entry.rs b/lib/entry/libimagentrygps/src/entry.rs index 6c6177eb..7c64b5c2 100644 --- a/lib/entry/libimagentrygps/src/entry.rs +++ b/lib/entry/libimagentrygps/src/entry.rs @@ -17,7 +17,7 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // -use types::*; +use crate::types::*; use libimagstore::store::Entry; @@ -107,7 +107,7 @@ mod tests { use libimagstore::store::Store; - use entry::*; + use crate::entry::*; fn setup_logging() { let _ = ::env_logger::try_init; diff --git a/lib/entry/libimagentrylink/src/external.rs b/lib/entry/libimagentrylink/src/external.rs index 93627235..3151ebe2 100644 --- a/lib/entry/libimagentrylink/src/external.rs +++ b/lib/entry/libimagentrylink/src/external.rs @@ -48,7 +48,7 @@ use failure::Fallible as Result; use failure::ResultExt; use failure::err_msg; -use internal::InternalLinker; +use crate::internal::InternalLinker; use self::iter::*; @@ -132,8 +132,8 @@ pub mod iter { use libimagutil::debug_result::*; use libimagstore::store::Store; - use internal::Link; - use internal::iter::LinkIter; + use crate::internal::Link; + use crate::internal::iter::LinkIter; use failure::Fallible as Result; use url::Url; @@ -262,7 +262,7 @@ pub mod iter { type Item = Result; fn next(&mut self) -> Option { - use external::Link; + use crate::external::Link; loop { let next = self.0 @@ -335,7 +335,7 @@ impl ExternalLinker for Entry { debug!("Iterating {} links = {:?}", links.len(), links); links.into_iter().map(|link| { let hash = hex::encode(Sha1::digest(&link.as_str().as_bytes())); - let file_id = ::module_path::new_id(format!("external/{}", hash)) + let file_id = crate::module_path::new_id(format!("external/{}", hash)) .map_dbg_err(|_| { format!("Failed to build StoreId for this hash '{:?}'", hash) })?; diff --git a/lib/entry/libimagentrylink/src/internal.rs b/lib/entry/libimagentrylink/src/internal.rs index be979e00..2ed5e5f6 100644 --- a/lib/entry/libimagentrylink/src/internal.rs +++ b/lib/entry/libimagentrylink/src/internal.rs @@ -504,7 +504,7 @@ pub mod store_check { fn check_link_consistency(&self) -> Result<()> { use std::collections::HashMap; - use internal::InternalLinker; + use crate::internal::InternalLinker; use libimagstore::storeid::StoreId; use libimagutil::debug_result::DebugResult; diff --git a/lib/entry/libimagentrymarkdown/src/processor.rs b/lib/entry/libimagentrymarkdown/src/processor.rs index 6476040b..87f03ad7 100644 --- a/lib/entry/libimagentrymarkdown/src/processor.rs +++ b/lib/entry/libimagentrymarkdown/src/processor.rs @@ -22,7 +22,7 @@ use std::collections::BTreeMap; use failure::Fallible as Result; use failure::ResultExt; use failure::Error; -use link::extract_links; +use crate::link::extract_links; use libimagentrylink::external::ExternalLinker; use libimagentrylink::internal::InternalLinker; diff --git a/lib/entry/libimagentryref/src/hasher.rs b/lib/entry/libimagentryref/src/hasher.rs index adadd606..8a20b254 100644 --- a/lib/entry/libimagentryref/src/hasher.rs +++ b/lib/entry/libimagentryref/src/hasher.rs @@ -38,7 +38,7 @@ pub mod sha1 { use failure::Fallible as Result; use sha1::{Sha1, Digest}; - use hasher::Hasher; + use crate::hasher::Hasher; pub struct Sha1Hasher; diff --git a/lib/entry/libimagentryref/src/reference.rs b/lib/entry/libimagentryref/src/reference.rs index da1ce325..729d23ef 100644 --- a/lib/entry/libimagentryref/src/reference.rs +++ b/lib/entry/libimagentryref/src/reference.rs @@ -37,7 +37,7 @@ use failure::Error; use failure::err_msg; use failure::ResultExt; -use hasher::Hasher; +use crate::hasher::Hasher; /// A configuration of "basepath name" -> "basepath path" mappings /// @@ -91,8 +91,8 @@ pub mod fassade { use failure::Fallible as Result; use failure::Error; - use hasher::sha1::Sha1Hasher; - use hasher::Hasher; + use crate::hasher::sha1::Sha1Hasher; + use crate::hasher::Hasher; use super::IsRef; pub trait RefFassade { @@ -436,7 +436,7 @@ mod test { use libimagstore::store::Entry; use super::*; - use hasher::Hasher; + use crate::hasher::Hasher; fn setup_logging() { let _ = ::env_logger::try_init(); diff --git a/lib/entry/libimagentryref/src/util.rs b/lib/entry/libimagentryref/src/util.rs index 1daf2e75..5f3559eb 100644 --- a/lib/entry/libimagentryref/src/util.rs +++ b/lib/entry/libimagentryref/src/util.rs @@ -21,7 +21,7 @@ use failure::Fallible as Result; use libimagrt::runtime::Runtime; -use reference::Config as RefConfig; +use crate::reference::Config as RefConfig; pub fn get_ref_config(rt: &Runtime, app_name: &'static str) -> Result { use toml_query::read::TomlValueReadExt; diff --git a/lib/entry/libimagentrytag/src/tagable.rs b/lib/entry/libimagentrytag/src/tagable.rs index 7186f72f..6ff5e4cc 100644 --- a/lib/entry/libimagentrytag/src/tagable.rs +++ b/lib/entry/libimagentrytag/src/tagable.rs @@ -29,8 +29,8 @@ use failure::Error; use failure::ResultExt; use failure::Fallible as Result; use failure::err_msg; -use tag::{Tag, TagSlice}; -use tag::is_tag_str; +use crate::tag::{Tag, TagSlice}; +use crate::tag::is_tag_str; use toml::Value; diff --git a/lib/entry/libimagentryview/src/builtin/editor.rs b/lib/entry/libimagentryview/src/builtin/editor.rs index 81d6d96e..8a702e63 100644 --- a/lib/entry/libimagentryview/src/builtin/editor.rs +++ b/lib/entry/libimagentryview/src/builtin/editor.rs @@ -23,7 +23,7 @@ use libimagstore::store::Entry; use libimagrt::runtime::Runtime; use libimagentryedit::edit::edit_in_tmpfile; -use viewer::Viewer; +use crate::viewer::Viewer; use failure::Fallible as Result; use failure::ResultExt; use failure::Error; diff --git a/lib/entry/libimagentryview/src/builtin/md.rs b/lib/entry/libimagentryview/src/builtin/md.rs index a3094741..1b977e59 100644 --- a/lib/entry/libimagentryview/src/builtin/md.rs +++ b/lib/entry/libimagentryview/src/builtin/md.rs @@ -26,7 +26,7 @@ use mdcat::{AnsiTerminal, ResourceAccess, TerminalSize}; use pulldown_cmark::Parser; use syntect::parsing::SyntaxSet; -use viewer::Viewer; +use crate::viewer::Viewer; use failure::Fallible as Result; use failure::Error; diff --git a/lib/entry/libimagentryview/src/builtin/plain.rs b/lib/entry/libimagentryview/src/builtin/plain.rs index 42c2d147..58b1ff49 100644 --- a/lib/entry/libimagentryview/src/builtin/plain.rs +++ b/lib/entry/libimagentryview/src/builtin/plain.rs @@ -21,7 +21,7 @@ use std::io::Write; use libimagstore::store::Entry; -use viewer::Viewer; +use crate::viewer::Viewer; use failure::Fallible as Result; pub struct PlainViewer { diff --git a/lib/entry/libimagentryview/src/builtin/stdout.rs b/lib/entry/libimagentryview/src/builtin/stdout.rs index a2762d04..a22eba0d 100644 --- a/lib/entry/libimagentryview/src/builtin/stdout.rs +++ b/lib/entry/libimagentryview/src/builtin/stdout.rs @@ -23,7 +23,7 @@ use libimagstore::store::Entry; use toml::ser::to_string; -use viewer::Viewer; +use crate::viewer::Viewer; use failure::Fallible as Result; pub struct StdoutViewer { diff --git a/lib/etc/libimagtimeui/src/date.rs b/lib/etc/libimagtimeui/src/date.rs index 9e6f46a8..0751d404 100644 --- a/lib/etc/libimagtimeui/src/date.rs +++ b/lib/etc/libimagtimeui/src/date.rs @@ -19,7 +19,7 @@ use chrono::naive::NaiveDate as ChronoNaiveDate; -use parse::Parse; +use crate::parse::Parse; pub struct Date { year: i32, @@ -61,7 +61,7 @@ impl Parse for Date { fn parse(s: &str) -> Option { use std::str::FromStr; use regex::Regex; - use parse::time_parse_regex; + use crate::parse::time_parse_regex; lazy_static! { static ref R: Regex = Regex::new(time_parse_regex()).unwrap(); @@ -108,7 +108,7 @@ impl Parse for Date { #[cfg(test)] mod test { use super::Date; - use parse::Parse; + use crate::parse::Parse; #[test] fn test_valid() { diff --git a/lib/etc/libimagtimeui/src/datetime.rs b/lib/etc/libimagtimeui/src/datetime.rs index 5fa79993..35159320 100644 --- a/lib/etc/libimagtimeui/src/datetime.rs +++ b/lib/etc/libimagtimeui/src/datetime.rs @@ -19,9 +19,9 @@ use chrono::naive::NaiveDateTime as ChronoNaiveDateTime; -use parse::Parse; -use date::Date; -use time::Time; +use crate::parse::Parse; +use crate::date::Date; +use crate::time::Time; pub struct DateTime { date: Date, diff --git a/lib/etc/libimagtimeui/src/time.rs b/lib/etc/libimagtimeui/src/time.rs index 89d4f546..a1efb86c 100644 --- a/lib/etc/libimagtimeui/src/time.rs +++ b/lib/etc/libimagtimeui/src/time.rs @@ -19,7 +19,7 @@ use chrono::naive::NaiveTime as ChronoNaiveTime; -use parse::Parse; +use crate::parse::Parse; pub struct Time { hour: u32, @@ -60,7 +60,7 @@ impl Parse for Time { fn parse(s: &str) -> Option