From 0888e4345c034b779a97cee382133937da3b24a8 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 11 Feb 2019 22:33:31 +0100 Subject: [PATCH] Use StoreId::local_display_string() for less errorhandling here Signed-off-by: Matthias Beyer --- bin/core/imag-diagnostics/src/main.rs | 14 ++------------ lib/core/libimagstore/src/iter.rs | 2 +- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/bin/core/imag-diagnostics/src/main.rs b/bin/core/imag-diagnostics/src/main.rs index 257af6a5..0102dd76 100644 --- a/bin/core/imag-diagnostics/src/main.rs +++ b/bin/core/imag-diagnostics/src/main.rs @@ -242,12 +242,7 @@ fn main() { if let Some((num, path)) = max_overall_byte_size { do_write!(out, "Largest Entry ({} bytes): {}", num, - path - .into_pathbuf() - .map_err_trace_exit_unwrap() - .to_str() - .unwrap_or("Failed converting path to string") - ); + path.local_display_string()); } do_write!(out, "{} average internal link count per entry", num_internal_links / n); @@ -255,12 +250,7 @@ fn main() { if let Some((num, path)) = max_internal_links { do_write!(out, "Entry with most internal links ({}): {}", num, - path - .into_pathbuf() - .map_err_trace_exit_unwrap() - .to_str() - .unwrap_or("Failed converting path to string") - ); + path.local_display_string()); } do_write!(out, "{} verified entries", verified_count); do_write!(out, "{} unverified entries", unverified_count); diff --git a/lib/core/libimagstore/src/iter.rs b/lib/core/libimagstore/src/iter.rs index 9ab6ed36..2e895b78 100644 --- a/lib/core/libimagstore/src/iter.rs +++ b/lib/core/libimagstore/src/iter.rs @@ -236,7 +236,7 @@ mod tests { use store::Store; use storeid::StoreId; - use file_abstraction::InMemoryFileAbstraction; + use file_abstraction::inmemory::InMemoryFileAbstraction; use libimagutil::variants::generate_variants; pub fn get_store() -> Store {