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 std::path::Path;
use clap::{App, ArgMatches};
use config::reader::from_file;
use config::types::Config as Cfg;
use config::types::Value as V;
use config::types::ScalarValue as S;
pub struct Configuration {
pub rtp : String,

View File

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

View File

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

View File

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

View File

@ -148,7 +148,7 @@ pub struct StorageBackendError {
pub action: String, // The file system action in words
pub desc: String, // A short 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 {
@ -161,7 +161,7 @@ impl StorageBackendError {
action: action,
desc: desc,
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;
use super::parser::{FileHeaderParser, Parser, ParserError};
use super::parser::FileHeaderParser;
use storage::file_id::*;
use std::fs::File as FSFile;
#[derive(Debug)]
pub enum FileHeaderSpec {
Null,

View File

@ -3,11 +3,11 @@ use std::path::{Path, PathBuf};
pub type FileID = String;
pub fn from_path_string(s: &String) -> FileID {
String::from("")
unimplemented!()
}
pub fn from_path(p: &Path) -> FileID {
String::from("")
unimplemented!()
}
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>)
-> Result<FileHeaderData, ParserError>
{
if (string.is_some()) {
if string.is_some() {
let s = string.unwrap();
debug!("Deserializing: {}", 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::Array(ref vec) => {
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) => {