diff --git a/src/book/bookconfig.rs b/src/book/bookconfig.rs index ba198eab..473a94b3 100644 --- a/src/book/bookconfig.rs +++ b/src/book/bookconfig.rs @@ -23,8 +23,8 @@ impl BookConfig { author: String::new(), description: String::new(), root: root.to_owned(), - dest: PathBuf::from("book"), - src: PathBuf::from("src"), + dest: root.join("book"), + src: root.join("src"), indent_spaces: 4, // indentation used for SUMMARY.md multilingual: false, } diff --git a/src/book/mdbook.rs b/src/book/mdbook.rs index ef203701..05fcb7cb 100644 --- a/src/book/mdbook.rs +++ b/src/book/mdbook.rs @@ -43,8 +43,8 @@ impl MDBook { MDBook { root: root.to_owned(), - dest: PathBuf::from("book"), - src: PathBuf::from("src"), + dest: root.join("book"), + src: root.join("src"), title: String::new(), author: String::new(), @@ -151,7 +151,8 @@ impl MDBook { debug!("[*]: item: {:?}", item); match *item { BookItem::Spacer => continue, - BookItem::Chapter(_, ref ch) | BookItem::Affix(ref ch) => { + BookItem::Chapter(_, ref ch) | + BookItem::Affix(ref ch) => { if ch.path != PathBuf::new() { let path = self.src.join(&ch.path); @@ -279,8 +280,8 @@ impl MDBook { pub fn read_config(mut self) -> Self { let config = BookConfig::new(&self.root) - .read_config(&self.root) - .to_owned(); + .read_config(&self.root) + .to_owned(); self.title = config.title; self.description = config.description;