mirror of
https://github.com/martinvonz/jj.git
synced 2025-02-06 11:34:54 +00:00
cli: use .display()
instead of debug format in two errors
This commit is contained in:
parent
cec4d6c214
commit
c8a04d6f69
1 changed files with 12 additions and 2 deletions
|
@ -1803,7 +1803,12 @@ fn edit_description(
|
||||||
.create_new(true)
|
.create_new(true)
|
||||||
.truncate(true)
|
.truncate(true)
|
||||||
.open(&description_file_path)
|
.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(description.as_bytes()).unwrap();
|
||||||
description_file
|
description_file
|
||||||
.write_all(b"\nJJ: Lines starting with \"JJ: \" (like this one) will be removed.\n")
|
.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()
|
let mut description_file = OpenOptions::new()
|
||||||
.read(true)
|
.read(true)
|
||||||
.open(&description_file_path)
|
.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![];
|
let mut buf = vec![];
|
||||||
description_file.read_to_end(&mut buf).unwrap();
|
description_file.read_to_end(&mut buf).unwrap();
|
||||||
let description = String::from_utf8(buf).unwrap();
|
let description = String::from_utf8(buf).unwrap();
|
||||||
|
|
Loading…
Reference in a new issue