From 37ce23fcaab9893df03b90d3449abaea5a06ecbd Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Fri, 12 Feb 2016 22:07:43 +0100 Subject: [PATCH] Remove EntryHeader::toml() calls and replace with ::into() and ::from() calls --- imag-store/src/retrieve.rs | 2 +- imag-store/src/util.rs | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/imag-store/src/retrieve.rs b/imag-store/src/retrieve.rs index 311f6bd1..2c0d19c5 100644 --- a/imag-store/src/retrieve.rs +++ b/imag-store/src/retrieve.rs @@ -50,7 +50,7 @@ fn print_entry(rt: &Runtime, scmd: &ArgMatches, e: FileLockEntry) { } else { debug!("Printing header as TOML..."); // We have to Value::Table() for Display - println!("{}", Value::Table(entry.get_header().toml().clone())) + println!("{}", Value::Table(entry.get_header().clone().into())) } } diff --git a/imag-store/src/util.rs b/imag-store/src/util.rs index 6ebb3a2d..987ab4f3 100644 --- a/imag-store/src/util.rs +++ b/imag-store/src/util.rs @@ -43,7 +43,7 @@ pub fn build_entry_path(rt: &Runtime, path_elem: &str) -> PathBuf { pub fn build_toml_header(matches: &ArgMatches, mut header: EntryHeader) -> EntryHeader { debug!("Building header from cli spec"); if let Some(headerspecs) = matches.values_of("header") { - let mut main = header.toml_mut(); + let mut main = header.into(); debug!("headerspec = {:?}", headerspecs); let kvs = headerspecs.into_iter() .filter_map(|hs| { @@ -61,9 +61,13 @@ pub fn build_toml_header(matches: &ArgMatches, mut header: EntryHeader) -> Entry insert_key_into(String::from(current.unwrap()), &mut split, value, &mut main); } } + + debug!("Header = {:?}", main); + EntryHeader::from(main) + } else { + debug!("Header = {:?}", header); + header } - debug!("Header = {:?}", header); - header } fn insert_key_into(current: String,