commit
14a28080c1
10
Cargo.toml
10
Cargo.toml
|
@ -22,19 +22,19 @@ serde_json = "0.9"
|
||||||
pulldown-cmark = "0.0.8"
|
pulldown-cmark = "0.0.8"
|
||||||
log = "0.3"
|
log = "0.3"
|
||||||
env_logger = "0.4.0"
|
env_logger = "0.4.0"
|
||||||
toml = { version = "0.2", features = ["serde"] }
|
toml = { version = "0.3", features = ["serde"] }
|
||||||
open = "1.1"
|
open = "1.1"
|
||||||
regex = "0.2.1"
|
regex = "0.2.1"
|
||||||
|
|
||||||
# Watch feature
|
# Watch feature
|
||||||
notify = { version = "3.0", optional = true }
|
notify = { version = "4.0", optional = true }
|
||||||
time = { version = "0.1.34", optional = true }
|
time = { version = "0.1.34", optional = true }
|
||||||
crossbeam = { version = "0.2.8", optional = true }
|
crossbeam = { version = "0.2.8", optional = true }
|
||||||
|
|
||||||
# Serve feature
|
# Serve feature
|
||||||
iron = { version = "0.4", optional = true }
|
iron = { version = "0.5", optional = true }
|
||||||
staticfile = { version = "0.3", optional = true }
|
staticfile = { version = "0.4", optional = true }
|
||||||
ws = { version = "0.5.1", optional = true}
|
ws = { version = "0.6", optional = true}
|
||||||
|
|
||||||
# Tests
|
# Tests
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
|
|
|
@ -82,13 +82,10 @@ impl BookConfig {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn parse_from_toml_string(&mut self, data: &str) -> &mut Self {
|
pub fn parse_from_toml_string(&mut self, data: &str) -> &mut Self {
|
||||||
|
let config = match toml::from_str(data) {
|
||||||
let mut parser = toml::Parser::new(data);
|
Ok(x) => {x},
|
||||||
|
Err(e) => {
|
||||||
let config = match parser.parse() {
|
error!("[*]: Toml parse errors in book.toml: {:?}", e);
|
||||||
Some(x) => {x},
|
|
||||||
None => {
|
|
||||||
error!("[*]: Toml parse errors in book.toml: {:?}", parser.errors);
|
|
||||||
exit(2);
|
exit(2);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue