From 56e72a223807a74b7a03c95046edf7b34feca620 Mon Sep 17 00:00:00 2001 From: Ruin0x11 Date: Wed, 15 Sep 2021 15:33:28 -0700 Subject: [PATCH] [localization] rustfmt --- src/book/book.rs | 10 ++++++++-- src/preprocess/links.rs | 11 +++++++++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/book/book.rs b/src/book/book.rs index 301a8457..08b18c49 100644 --- a/src/book/book.rs +++ b/src/book/book.rs @@ -55,14 +55,20 @@ fn load_single_book_translation>( let mut summary_content = String::new(); File::open(&summary_md) - .with_context(|| format!("Couldn't open SUMMARY.md in {:?} directory", localized_src_dir))? + .with_context(|| { + format!( + "Couldn't open SUMMARY.md in {:?} directory", + localized_src_dir + ) + })? .read_to_string(&mut summary_content)?; let summary = parse_summary(&summary_content) .with_context(|| format!("Summary parsing failed for file={:?}", summary_md))?; if cfg.build.create_missing { - create_missing(&localized_src_dir, &summary).with_context(|| "Unable to create missing chapters")?; + create_missing(&localized_src_dir, &summary) + .with_context(|| "Unable to create missing chapters")?; } load_book_from_disk(&summary, localized_src_dir, fallback_src_dir, cfg) diff --git a/src/preprocess/links.rs b/src/preprocess/links.rs index 9282d642..f3d8d847 100644 --- a/src/preprocess/links.rs +++ b/src/preprocess/links.rs @@ -62,7 +62,14 @@ impl Preprocessor for LinkPreprocessor { let fallback = fallback_src_dir.join(parent); let mut chapter_title = ch.name.clone(); - let content = replace_all(&ch.content, base, Some(fallback), chapter_path, 0, &mut chapter_title); + let content = replace_all( + &ch.content, + base, + Some(fallback), + chapter_path, + 0, + &mut chapter_title, + ); ch.content = content; if chapter_title != ch.name { ctx.chapter_titles @@ -83,7 +90,7 @@ fn replace_all( fallback: Option, source: P2, depth: usize, - chapter_title: &mut String + chapter_title: &mut String, ) -> String where P1: AsRef,