From c6edd4e5d5cbcbc16063a10181aee9626822d273 Mon Sep 17 00:00:00 2001 From: Jiayi Zhao Date: Mon, 16 Mar 2020 16:14:17 -0400 Subject: better error handling for threads - code cleanup --- src/config/mimetype.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/config') diff --git a/src/config/mimetype.rs b/src/config/mimetype.rs index 5538fb0..f6d81de 100644 --- a/src/config/mimetype.rs +++ b/src/config/mimetype.rs @@ -57,7 +57,7 @@ impl JoshutoMimetypeEntry { self } - pub fn set_confirm_exit(mut self, confirm_exit: bool) -> Self { + pub fn confirm_exit(mut self, confirm_exit: bool) -> Self { self._confirm_exit = confirm_exit; self } @@ -125,14 +125,17 @@ impl std::fmt::Display for JoshutoMimetypeEntry { .iter() .for_each(|arg| write!(f, " {}", arg).unwrap()); - f.write_str("\t[").unwrap(); + f.write_str("\t\t").unwrap(); if self.get_fork() { - f.write_str("fork,").unwrap(); + f.write_str("[fork]").unwrap(); } if self.get_silent() { - f.write_str("silent").unwrap(); + f.write_str("[silent]").unwrap(); } - f.write_str("]") + if self.get_confirm_exit() { + f.write_str("[confirm-exit]").unwrap(); + } + f.write_str("") } } -- cgit v1.2.3