Remove unnecessary mem::replace

This commit is contained in:
Jaime Valdemoros 2018-01-07 16:43:34 +00:00
parent 966811061b
commit f282a553fd
1 changed files with 2 additions and 2 deletions

View File

@ -19,11 +19,11 @@ impl Preprocessor for ReplaceAllPreprocessor {
for section in &mut book.sections { for section in &mut book.sections {
match *section { match *section {
BookItem::Chapter(ref mut ch) => { BookItem::Chapter(ref mut ch) => {
let content = ::std::mem::replace(&mut ch.content, String::new());
let base = ch.path.parent() let base = ch.path.parent()
.map(|dir| self.src_dir.join(dir)) .map(|dir| self.src_dir.join(dir))
.ok_or_else(|| String::from("Invalid bookitem path!"))?; .ok_or_else(|| String::from("Invalid bookitem path!"))?;
ch.content = replace_all(&content, base)? let content = replace_all(&ch.content, base)?;
ch.content = content
} }
_ => {} _ => {}
} }