From c8a04d6f69041374533fa5ce8d6ea2649de7d317 Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Wed, 14 Dec 2022 18:36:33 -0800 Subject: [PATCH] cli: use `.display()` instead of debug format in two errors --- src/commands.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/commands.rs b/src/commands.rs index 21d4dca9d..02bfd49d4 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -1803,7 +1803,12 @@ fn edit_description( .create_new(true) .truncate(true) .open(&description_file_path) - .unwrap_or_else(|_| panic!("failed to open {:?} for write", &description_file_path)); + .unwrap_or_else(|_| { + panic!( + "failed to open {} for write", + description_file_path.display() + ) + }); description_file.write_all(description.as_bytes()).unwrap(); description_file .write_all(b"\nJJ: Lines starting with \"JJ: \" (like this one) will be removed.\n") @@ -1829,7 +1834,12 @@ fn edit_description( let mut description_file = OpenOptions::new() .read(true) .open(&description_file_path) - .unwrap_or_else(|_| panic!("failed to open {:?} for read", &description_file_path)); + .unwrap_or_else(|_| { + panic!( + "failed to open {} for read", + description_file_path.display() + ) + }); let mut buf = vec![]; description_file.read_to_end(&mut buf).unwrap(); let description = String::from_utf8(buf).unwrap();