Remove unneeded calls to deref()

This commit is contained in:
Matthias Beyer 2016-04-21 13:23:01 +02:00
parent 69a73f0a67
commit 523eef009d

View file

@ -41,7 +41,7 @@ pub fn retrieve(rt: &Runtime) {
fn print_entry(rt: &Runtime, scmd: &ArgMatches, e: FileLockEntry) { fn print_entry(rt: &Runtime, scmd: &ArgMatches, e: FileLockEntry) {
if do_print_raw(scmd) { if do_print_raw(scmd) {
debug!("Printing raw content..."); debug!("Printing raw content...");
println!("{}", e.deref().to_str()); println!("{}", e.to_str());
} else if do_filter(scmd) { } else if do_filter(scmd) {
debug!("Filtering..."); debug!("Filtering...");
warn!("Filtering via header specs is currently now supported."); warn!("Filtering via header specs is currently now supported.");
@ -49,7 +49,6 @@ fn print_entry(rt: &Runtime, scmd: &ArgMatches, e: FileLockEntry) {
unimplemented!() unimplemented!()
} else { } else {
debug!("Printing structured..."); debug!("Printing structured...");
let entry = e.deref();
if do_print_header(scmd) { if do_print_header(scmd) {
debug!("Printing header..."); debug!("Printing header...");
if do_print_header_as_json(rt.cli()) { if do_print_header_as_json(rt.cli()) {
@ -60,13 +59,13 @@ fn print_entry(rt: &Runtime, scmd: &ArgMatches, e: FileLockEntry) {
} else { } else {
debug!("Printing header as TOML..."); debug!("Printing header as TOML...");
// We have to Value::Table() for Display // We have to Value::Table() for Display
println!("{}", Value::Table(entry.get_header().clone().into())) println!("{}", Value::Table(e.get_header().clone().into()))
} }
} }
if do_print_content(scmd) { if do_print_content(scmd) {
debug!("Printing content..."); debug!("Printing content...");
println!("{}", entry.get_content()); println!("{}", e.get_content());
} }
} }