Clean up some Path code in bookconfig
This commit is contained in:
parent
3ffd24df63
commit
09729aaca5
|
@ -62,13 +62,13 @@ impl BookConfig {
|
||||||
|
|
||||||
// Read book.toml or book.json if exists
|
// Read book.toml or book.json if exists
|
||||||
|
|
||||||
if Path::new(root.join("book.toml").as_os_str()).exists() {
|
if root.join("book.toml").exists() {
|
||||||
|
|
||||||
debug!("[*]: Reading config");
|
debug!("[*]: Reading config");
|
||||||
let data = read_file(root.join("book.toml"));
|
let data = read_file(root.join("book.toml"));
|
||||||
self.parse_from_toml_string(&data);
|
self.parse_from_toml_string(&data);
|
||||||
|
|
||||||
} else if Path::new(root.join("book.json").as_os_str()).exists() {
|
} else if root.join("book.json").exists() {
|
||||||
|
|
||||||
debug!("[*]: Reading config");
|
debug!("[*]: Reading config");
|
||||||
let data = read_file(root.join("book.json"));
|
let data = read_file(root.join("book.json"));
|
||||||
|
|
Loading…
Reference in New Issue