From a3a5386da01195f0392468ac179fc4166b5c773c Mon Sep 17 00:00:00 2001 From: apatniv Date: Sat, 5 Dec 2020 20:17:45 -0500 Subject: [PATCH 1/2] Add more context regarding which missing file creation failed --- src/book/book.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/book/book.rs b/src/book/book.rs index 35f66438..07996cad 100644 --- a/src/book/book.rs +++ b/src/book/book.rs @@ -49,7 +49,7 @@ fn create_missing(src_dir: &Path, summary: &Summary) -> Result<()> { } debug!("Creating missing file {}", filename.display()); - let mut f = File::create(&filename)?; + let mut f = File::create(&filename).with_context(|| format!("Unable to create missing file: {}", filename.display()))?; writeln!(f, "# {}", link.name)?; } } From ef993e8cc2486fa8b3d14fd089c6aafbf0a3be14 Mon Sep 17 00:00:00 2001 From: apatniv Date: Sat, 5 Dec 2020 20:27:03 -0500 Subject: [PATCH 2/2] Run rust formmater --- src/book/book.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/book/book.rs b/src/book/book.rs index 07996cad..994238bd 100644 --- a/src/book/book.rs +++ b/src/book/book.rs @@ -49,7 +49,9 @@ fn create_missing(src_dir: &Path, summary: &Summary) -> Result<()> { } debug!("Creating missing file {}", filename.display()); - let mut f = File::create(&filename).with_context(|| format!("Unable to create missing file: {}", filename.display()))?; + let mut f = File::create(&filename).with_context(|| { + format!("Unable to create missing file: {}", filename.display()) + })?; writeln!(f, "# {}", link.name)?; } }