parent
bc9772baf0
commit
4cd80a3df2
56
Cargo.lock
generated
56
Cargo.lock
generated
@ -1703,7 +1703,7 @@ dependencies = [
|
|||||||
"tera",
|
"tera",
|
||||||
"termcolor",
|
"termcolor",
|
||||||
"time",
|
"time",
|
||||||
"toml",
|
"toml 0.7.0",
|
||||||
"unic-langid",
|
"unic-langid",
|
||||||
"unicode-segmentation",
|
"unicode-segmentation",
|
||||||
"url",
|
"url",
|
||||||
@ -2257,6 +2257,15 @@ dependencies = [
|
|||||||
"syn",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "nom8"
|
||||||
|
version = "0.2.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ae01545c9c7fc4486ab7debaf2aad7003ac19431791868fb2e8066df97fad2f8"
|
||||||
|
dependencies = [
|
||||||
|
"memchr",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nom_locate"
|
name = "nom_locate"
|
||||||
version = "1.0.0"
|
version = "1.0.0"
|
||||||
@ -3221,6 +3230,15 @@ dependencies = [
|
|||||||
"serde",
|
"serde",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "serde_spanned"
|
||||||
|
version = "0.6.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2c68e921cef53841b8925c2abadd27c9b891d9613bdc43d6b823062866df38e8"
|
||||||
|
dependencies = [
|
||||||
|
"serde",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_urlencoded"
|
name = "serde_urlencoded"
|
||||||
version = "0.7.1"
|
version = "0.7.1"
|
||||||
@ -3706,6 +3724,40 @@ dependencies = [
|
|||||||
"serde",
|
"serde",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "toml"
|
||||||
|
version = "0.7.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2f560bc7fb3eb31f5eee1340c68a2160cad39605b7b9c9ec32045ddbdee13b85"
|
||||||
|
dependencies = [
|
||||||
|
"serde",
|
||||||
|
"serde_spanned",
|
||||||
|
"toml_datetime",
|
||||||
|
"toml_edit",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "toml_datetime"
|
||||||
|
version = "0.6.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "886f31a9b85b6182cabd4d8b07df3b451afcc216563748201490940d2a28ed36"
|
||||||
|
dependencies = [
|
||||||
|
"serde",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "toml_edit"
|
||||||
|
version = "0.19.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "233d8716cdc5d20ec88a18a839edaf545edc71efa4a5ff700ef4a102c26cd8fa"
|
||||||
|
dependencies = [
|
||||||
|
"indexmap",
|
||||||
|
"nom8",
|
||||||
|
"serde",
|
||||||
|
"serde_spanned",
|
||||||
|
"toml_datetime",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tower-service"
|
name = "tower-service"
|
||||||
version = "0.3.2"
|
version = "0.3.2"
|
||||||
@ -4179,7 +4231,7 @@ version = "0.1.12"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b68db261ef59e9e52806f688020631e987592bd83619edccda9c47d42cde4f6c"
|
checksum = "b68db261ef59e9e52806f688020631e987592bd83619edccda9c47d42cde4f6c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"toml",
|
"toml 0.5.11",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -392,20 +392,20 @@ title = "Hello"
|
|||||||
description = "hey there"
|
description = "hey there"
|
||||||
|
|
||||||
[extra]
|
[extra]
|
||||||
some-date = 2002-14-01
|
some-date = 2002-11-01
|
||||||
"#); "toml")]
|
"#); "toml")]
|
||||||
#[test_case(&RawFrontMatter::Yaml(r#"
|
#[test_case(&RawFrontMatter::Yaml(r#"
|
||||||
title: Hello
|
title: Hello
|
||||||
description: hey there
|
description: hey there
|
||||||
|
|
||||||
extra:
|
extra:
|
||||||
some-date: 2002-14-01
|
some-date: 2002-11-01
|
||||||
"#); "yaml")]
|
"#); "yaml")]
|
||||||
fn can_parse_dates_in_extra(content: &RawFrontMatter) {
|
fn can_parse_dates_in_extra(content: &RawFrontMatter) {
|
||||||
let res = PageFrontMatter::parse(content);
|
let res = PageFrontMatter::parse(content);
|
||||||
println!("{:?}", res);
|
println!("{:?}", res);
|
||||||
assert!(res.is_ok());
|
assert!(res.is_ok());
|
||||||
assert_eq!(res.unwrap().extra["some-date"], to_value("2002-14-01").unwrap());
|
assert_eq!(res.unwrap().extra["some-date"], to_value("2002-11-01").unwrap());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test_case(&RawFrontMatter::Toml(r#"
|
#[test_case(&RawFrontMatter::Toml(r#"
|
||||||
@ -413,7 +413,7 @@ title = "Hello"
|
|||||||
description = "hey there"
|
description = "hey there"
|
||||||
|
|
||||||
[extra.something]
|
[extra.something]
|
||||||
some-date = 2002-14-01
|
some-date = 2002-11-01
|
||||||
"#); "toml")]
|
"#); "toml")]
|
||||||
#[test_case(&RawFrontMatter::Yaml(r#"
|
#[test_case(&RawFrontMatter::Yaml(r#"
|
||||||
title: Hello
|
title: Hello
|
||||||
@ -421,13 +421,13 @@ description: hey there
|
|||||||
|
|
||||||
extra:
|
extra:
|
||||||
something:
|
something:
|
||||||
some-date: 2002-14-01
|
some-date: 2002-11-01
|
||||||
"#); "yaml")]
|
"#); "yaml")]
|
||||||
fn can_parse_nested_dates_in_extra(content: &RawFrontMatter) {
|
fn can_parse_nested_dates_in_extra(content: &RawFrontMatter) {
|
||||||
let res = PageFrontMatter::parse(content);
|
let res = PageFrontMatter::parse(content);
|
||||||
println!("{:?}", res);
|
println!("{:?}", res);
|
||||||
assert!(res.is_ok());
|
assert!(res.is_ok());
|
||||||
assert_eq!(res.unwrap().extra["something"]["some-date"], to_value("2002-14-01").unwrap());
|
assert_eq!(res.unwrap().extra["something"]["some-date"], to_value("2002-11-01").unwrap());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test_case(&RawFrontMatter::Toml(r#"
|
#[test_case(&RawFrontMatter::Toml(r#"
|
||||||
|
@ -37,7 +37,7 @@ syntect = "5"
|
|||||||
tera = { version = "1.17", features = ["preserve_order", "date-locale"] }
|
tera = { version = "1.17", features = ["preserve_order", "date-locale"] }
|
||||||
termcolor = "1.0.4"
|
termcolor = "1.0.4"
|
||||||
time = "0.3"
|
time = "0.3"
|
||||||
toml = "0.5"
|
toml = "0.7"
|
||||||
unic-langid = "0.9"
|
unic-langid = "0.9"
|
||||||
unicode-segmentation = "1.2"
|
unicode-segmentation = "1.2"
|
||||||
url = "2"
|
url = "2"
|
||||||
|
Loading…
Reference in New Issue
Block a user