From f50c54b6a4248e9ead96c45534cf8752de348628 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 16 Jul 2016 22:51:51 +0200 Subject: [PATCH] Add deps: log, toml --- imag-view/src/viewer/mod.rs | 16 -------------- imag-view/src/viewer/stdout.rs | 40 ---------------------------------- libimagentryview/Cargo.toml | 2 ++ libimagentryview/src/lib.rs | 3 +++ 4 files changed, 5 insertions(+), 56 deletions(-) delete mode 100644 imag-view/src/viewer/mod.rs delete mode 100644 imag-view/src/viewer/stdout.rs diff --git a/imag-view/src/viewer/mod.rs b/imag-view/src/viewer/mod.rs deleted file mode 100644 index f7e3653f..00000000 --- a/imag-view/src/viewer/mod.rs +++ /dev/null @@ -1,16 +0,0 @@ -pub mod stdout; - -use libimagstore::store::FileLockEntry; - -pub struct ViewInformation<'a> { - pub entry: FileLockEntry<'a>, - pub view_header: bool, - pub view_content: bool, - pub view_copy: bool, - pub keep_copy: bool, -} - -pub trait Viewer { - fn view(&self, vi: ViewInformation); -} - diff --git a/imag-view/src/viewer/stdout.rs b/imag-view/src/viewer/stdout.rs deleted file mode 100644 index 18536da6..00000000 --- a/imag-view/src/viewer/stdout.rs +++ /dev/null @@ -1,40 +0,0 @@ -use std::io::{Stdout, stdout}; - -use toml::encode_str; - -use viewer::{ViewInformation, Viewer}; - -pub struct StdoutViewer { - out: Stdout, -} - -impl StdoutViewer { - - pub fn new() -> StdoutViewer { - StdoutViewer { out: stdout() } - } - -} - -impl Viewer for StdoutViewer { - - fn view(&self, vi: ViewInformation) { - if vi.view_copy { - unimplemented!(); - } - - if vi.view_header { - debug!("Going to display header: {:?}", vi.entry.get_header().header()); - println!("{}", encode_str(vi.entry.get_header().header())); - } - - if vi.view_content { - println!("{}", vi.entry.get_content()); - } - - if vi.view_copy && !vi.keep_copy { - unimplemented!() - } - } - -} diff --git a/libimagentryview/Cargo.toml b/libimagentryview/Cargo.toml index c264e818..f827d414 100644 --- a/libimagentryview/Cargo.toml +++ b/libimagentryview/Cargo.toml @@ -4,6 +4,8 @@ version = "0.2.0" authors = ["Matthias Beyer "] [dependencies] +log = "0.3" +toml = "0.1.25" [dependencies.libimagstore] path = "../libimagstore" diff --git a/libimagentryview/src/lib.rs b/libimagentryview/src/lib.rs index 950332c5..76d0001e 100644 --- a/libimagentryview/src/lib.rs +++ b/libimagentryview/src/lib.rs @@ -14,6 +14,9 @@ while_true, )] +#[macro_use] extern crate log; +extern crate toml; + extern crate libimagstore; #[macro_use] extern crate libimagerror;