Merge branch 'fixes'

This commit is contained in:
Matthias Beyer 2015-11-27 17:02:14 +01:00
commit 5f564b5e8d
8 changed files with 9 additions and 17 deletions

View File

@ -3,11 +3,8 @@ extern crate clap;
use cli::CliConfig; use cli::CliConfig;
use std::path::Path; use std::path::Path;
use clap::{App, ArgMatches};
use config::reader::from_file; use config::reader::from_file;
use config::types::Config as Cfg; use config::types::Config as Cfg;
use config::types::Value as V;
use config::types::ScalarValue as S;
pub struct Configuration { pub struct Configuration {
pub rtp : String, pub rtp : String,

View File

@ -21,7 +21,7 @@ mod storage;
fn main() { fn main() {
let yaml = load_yaml!("../etc/cli.yml"); let yaml = load_yaml!("../etc/cli.yml");
let app = App::from_yaml(yaml); let app = App::from_yaml(yaml);
let mut config = CliConfig::new(app); let config = CliConfig::new(app);
let configuration = Configuration::new(&config); let configuration = Configuration::new(&config);
let logger = ImagLogger::init(&configuration, &config); let logger = ImagLogger::init(&configuration, &config);

View File

@ -3,10 +3,9 @@ use std::error::Error;
use std::fmt::Formatter; use std::fmt::Formatter;
use std::fmt::Result as FMTResult; use std::fmt::Result as FMTResult;
use std::fmt::Display; use std::fmt::Display;
use std::path::Path;
use std::result::Result; use std::result::Result;
use storage::backend::{StorageBackend, StorageBackendError}; use storage::backend::StorageBackend;
use self::command::ExecutableCommand; use self::command::ExecutableCommand;
mod command; mod command;

View File

@ -3,8 +3,6 @@ extern crate log;
pub use cli::CliConfig; pub use cli::CliConfig;
pub use configuration::Configuration as Cfg; pub use configuration::Configuration as Cfg;
use std::io::stderr;
use std::io::Write;
use log::{LogRecord, LogLevel, LogLevelFilter, LogMetadata, SetLoggerError}; use log::{LogRecord, LogLevel, LogLevelFilter, LogMetadata, SetLoggerError};
pub struct ImagLogger { pub struct ImagLogger {

View File

@ -148,7 +148,7 @@ pub struct StorageBackendError {
pub action: String, // The file system action in words pub action: String, // The file system action in words
pub desc: String, // A short description pub desc: String, // A short description
pub explanation: String, // A long, user friendly description pub explanation: String, // A long, user friendly description
pub dataDump: Option<String> // Data dump, if any pub data_dump: Option<String> // Data dump, if any
} }
impl StorageBackendError { impl StorageBackendError {
@ -161,7 +161,7 @@ impl StorageBackendError {
action: action, action: action,
desc: desc, desc: desc,
explanation: explan, explanation: explan,
dataDump: data, data_dump: data,
} }
} }
} }

View File

@ -2,11 +2,9 @@ use std::error::Error;
use std::fmt::{Debug, Display, Formatter}; use std::fmt::{Debug, Display, Formatter};
use std::fmt; use std::fmt;
use super::parser::{FileHeaderParser, Parser, ParserError}; use super::parser::FileHeaderParser;
use storage::file_id::*; use storage::file_id::*;
use std::fs::File as FSFile;
#[derive(Debug)] #[derive(Debug)]
pub enum FileHeaderSpec { pub enum FileHeaderSpec {
Null, Null,

View File

@ -3,11 +3,11 @@ use std::path::{Path, PathBuf};
pub type FileID = String; pub type FileID = String;
pub fn from_path_string(s: &String) -> FileID { pub fn from_path_string(s: &String) -> FileID {
String::from("") unimplemented!()
} }
pub fn from_path(p: &Path) -> FileID { pub fn from_path(p: &Path) -> FileID {
String::from("") unimplemented!()
} }
pub fn from_pathbuf(p: &PathBuf) -> FileID { pub fn from_pathbuf(p: &PathBuf) -> FileID {

View File

@ -26,7 +26,7 @@ impl<'a> FileHeaderParser<'a> for JsonHeaderParser<'a> {
fn read(&self, string: Option<String>) fn read(&self, string: Option<String>)
-> Result<FileHeaderData, ParserError> -> Result<FileHeaderData, ParserError>
{ {
if (string.is_some()) { if string.is_some() {
let s = string.unwrap(); let s = string.unwrap();
debug!("Deserializing: {}", s); debug!("Deserializing: {}", s);
let fromstr : R<Value> = from_str(&s[..]); let fromstr : R<Value> = from_str(&s[..]);
@ -59,7 +59,7 @@ fn visit_json(v: &Value) -> FileHeaderData {
&Value::String(ref s) => FileHeaderData::Text(s.clone()), &Value::String(ref s) => FileHeaderData::Text(s.clone()),
&Value::Array(ref vec) => { &Value::Array(ref vec) => {
FileHeaderData::Array { FileHeaderData::Array {
values: Box::new(vec.clone().into_iter().map(|i| visit_json(v)).collect()) values: Box::new(vec.clone().into_iter().map(|i| visit_json(&i)).collect())
} }
}, },
&Value::Object(ref btree) => { &Value::Object(ref btree) => {