Update toml-query: 0.2.0 -> 0.3.0
This commit is contained in:
parent
297eeb1bd2
commit
fad981a40f
2 changed files with 6 additions and 3 deletions
|
@ -18,7 +18,7 @@ chrono = "0.2"
|
||||||
log = "0.3"
|
log = "0.3"
|
||||||
semver = "0.5"
|
semver = "0.5"
|
||||||
toml = "0.4.*"
|
toml = "0.4.*"
|
||||||
toml-query = "0.2.*"
|
toml-query = "0.3.*"
|
||||||
regex = "0.1"
|
regex = "0.1"
|
||||||
itertools = "0.5"
|
itertools = "0.5"
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ pub fn get_default_diary_name(rt: &Runtime) -> Option<String> {
|
||||||
get_diary_config_section(rt)
|
get_diary_config_section(rt)
|
||||||
.and_then(|config| {
|
.and_then(|config| {
|
||||||
match config.read(&String::from("default_diary")) {
|
match config.read(&String::from("default_diary")) {
|
||||||
Ok(&Value::String(ref s)) => Some(s.clone()),
|
Ok(Some(&Value::String(ref s))) => Some(s.clone()),
|
||||||
_ => None,
|
_ => None,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -36,5 +36,8 @@ pub fn get_default_diary_name(rt: &Runtime) -> Option<String> {
|
||||||
pub fn get_diary_config_section<'a>(rt: &'a Runtime) -> Option<&'a Value> {
|
pub fn get_diary_config_section<'a>(rt: &'a Runtime) -> Option<&'a Value> {
|
||||||
rt.config()
|
rt.config()
|
||||||
.map(|config| config.config())
|
.map(|config| config.config())
|
||||||
.and_then(|config| config.read(&String::from("diary")).ok())
|
.and_then(|config| match config.read(&String::from("diary")) {
|
||||||
|
Ok(x) => x,
|
||||||
|
Err(_) => None,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue