cli: use .display() instead of debug format in two errors

This commit is contained in:
Martin von Zweigbergk 2022-12-14 18:36:33 -08:00 committed by Martin von Zweigbergk
parent cec4d6c214
commit c8a04d6f69

View file

@ -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();