diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2016-07-31 22:02:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-31 22:02:37 +0200 |
commit | 989ee1864ac1b79a2be1b9d6dbccf899dd3932bd (patch) | |
tree | b53a5cbcb0d370d32f7ea1192fb05f3ef22d0cdd /imag-diary | |
parent | 2b0efee4ccf816cefaeda2f09e07fd85995dd5a5 (diff) | |
parent | dcd72765bc9754b06a6ee5b20a9ce850a9868f4b (diff) |
Merge pull request #604 from matthiasbeyer/imag-diary/warnings
Imag diary/warnings
Diffstat (limited to 'imag-diary')
-rw-r--r-- | imag-diary/src/create.rs | 4 | ||||
-rw-r--r-- | imag-diary/src/main.rs | 20 | ||||
-rw-r--r-- | imag-diary/src/view.rs | 4 |
3 files changed, 20 insertions, 8 deletions
diff --git a/imag-diary/src/create.rs b/imag-diary/src/create.rs index 0fb46cb9..5777ef6a 100644 --- a/imag-diary/src/create.rs +++ b/imag-diary/src/create.rs @@ -34,7 +34,7 @@ pub fn create(rt: &Runtime) { let id = match create.value_of("timed") { Some("h") | Some("hourly") => { debug!("Creating hourly-timed entry"); - let mut time = DiaryId::now(String::from(diary.name())); + let time = DiaryId::now(String::from(diary.name())); let hr = create .value_of("hour") .map(|v| { debug!("Creating hourly entry with hour = {:?}", v); v }) @@ -50,7 +50,7 @@ pub fn create(rt: &Runtime) { Some("m") | Some("minutely") => { debug!("Creating minutely-timed entry"); - let mut time = DiaryId::now(String::from(diary.name())); + let time = DiaryId::now(String::from(diary.name())); let hr = create .value_of("hour") .map(|h| { debug!("hour = {:?}", h); h }) diff --git a/imag-diary/src/main.rs b/imag-diary/src/main.rs index 647a9b25..c65780a8 100644 --- a/imag-diary/src/main.rs +++ b/imag-diary/src/main.rs @@ -1,3 +1,18 @@ +#![deny( + 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; #[macro_use] extern crate version; extern crate clap; @@ -57,7 +72,6 @@ fn main() { "delete" => delete(&rt), "edit" => edit(&rt), "list" => list(&rt), - "diary" => diary(&rt), "view" => view(&rt), _ => { debug!("Unknown command"); // More error handling @@ -66,7 +80,3 @@ fn main() { }); } -fn diary(rt: &Runtime) { - unimplemented!() -} - diff --git a/imag-diary/src/view.rs b/imag-diary/src/view.rs index 0d0f5317..e96e0649 100644 --- a/imag-diary/src/view.rs +++ b/imag-diary/src/view.rs @@ -24,7 +24,9 @@ pub fn view(rt: &Runtime) { for entry in entries.into_iter().filter_map(Result::ok) { let id = entry.diary_id(); println!("{} :\n", id); - pv.view_entry(&entry); + if let Err(e) = pv.view_entry(&entry) { + trace_error(&e); + }; println!("\n---\n"); } }, |