Merge pull request #604 from matthiasbeyer/imag-diary/warnings

Imag diary/warnings
This commit is contained in:
Matthias Beyer 2016-07-31 22:02:37 +02:00 committed by GitHub
commit 989ee1864a
3 changed files with 20 additions and 8 deletions

View file

@ -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 })

View file

@ -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!()
}

View file

@ -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");
}
},