From f282a553fdfa23be7410ad2fcd5115d87904a8a2 Mon Sep 17 00:00:00 2001 From: Jaime Valdemoros Date: Sun, 7 Jan 2018 16:43:34 +0000 Subject: [PATCH] Remove unnecessary mem::replace --- src/preprocess/links.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/preprocess/links.rs b/src/preprocess/links.rs index 6a92defe..1ad63165 100644 --- a/src/preprocess/links.rs +++ b/src/preprocess/links.rs @@ -19,11 +19,11 @@ impl Preprocessor for ReplaceAllPreprocessor { for section in &mut book.sections { match *section { BookItem::Chapter(ref mut ch) => { - let content = ::std::mem::replace(&mut ch.content, String::new()); let base = ch.path.parent() .map(|dir| self.src_dir.join(dir)) .ok_or_else(|| String::from("Invalid bookitem path!"))?; - ch.content = replace_all(&content, base)? + let content = replace_all(&ch.content, base)?; + ch.content = content } _ => {} }