Skip to content

Commit 8bc6945

Browse files
committed
Include the new Book struct in a hashmap alongside the old representation
1 parent 76ca969 commit 8bc6945

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/book/mod.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@ use std::io;
2020
use std::io::Write;
2121
use std::io::ErrorKind;
2222
use std::process::Command;
23+
use std::collections::HashMap;
2324

2425
use {theme, parse, utils};
2526
use renderer::{Renderer, HtmlHandlebars};
2627

2728

28-
pub struct MDBook {
29+
pub struct MDBook<'a> {
2930
root: PathBuf,
3031
dest: PathBuf,
3132
src: PathBuf,
@@ -36,12 +37,13 @@ pub struct MDBook {
3637
pub description: String,
3738

3839
pub content: Vec<BookItem>,
40+
books: HashMap<&'a str, Book>,
3941
renderer: Box<Renderer>,
4042

4143
livereload: Option<String>,
4244
}
4345

44-
impl MDBook {
46+
impl<'a> MDBook<'a> {
4547
/// Create a new `MDBook` struct with root directory `root`
4648
///
4749
/// Default directory paths:
@@ -69,6 +71,7 @@ impl MDBook {
6971
description: String::new(),
7072

7173
content: vec![],
74+
books: HashMap::new(),
7275
renderer: Box::new(HtmlHandlebars::new()),
7376

7477
livereload: None,

0 commit comments

Comments
 (0)