mirror of
https://github.com/askama-rs/askama.git
synced 2025-10-02 07:20:55 +00:00
feature: serde-json → serde_json
This commit is contained in:
parent
64a8094aaf
commit
dcabf0cf1a
@ -193,7 +193,7 @@ fn test_json() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "serde-json")]
|
#[cfg(feature = "serde_json")]
|
||||||
#[derive(Template)]
|
#[derive(Template)]
|
||||||
#[template(
|
#[template(
|
||||||
source = r#"{
|
source = r#"{
|
||||||
@ -207,7 +207,7 @@ struct PrettyJsonTemplate<'a> {
|
|||||||
bar: &'a Value,
|
bar: &'a Value,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "serde-json")]
|
#[cfg(feature = "serde_json")]
|
||||||
#[test]
|
#[test]
|
||||||
fn test_pretty_json() {
|
fn test_pretty_json() {
|
||||||
let val = json!({"arr": [ "one", 2, true, null ]});
|
let val = json!({"arr": [ "one", 2, true, null ]});
|
||||||
@ -232,7 +232,7 @@ fn test_pretty_json() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "serde-json")]
|
#[cfg(feature = "serde_json")]
|
||||||
#[derive(Template)]
|
#[derive(Template)]
|
||||||
#[template(source = r#"{{ bar|json(indent)|safe }}"#, ext = "txt")]
|
#[template(source = r#"{{ bar|json(indent)|safe }}"#, ext = "txt")]
|
||||||
struct DynamicJsonTemplate<'a> {
|
struct DynamicJsonTemplate<'a> {
|
||||||
@ -240,7 +240,7 @@ struct DynamicJsonTemplate<'a> {
|
|||||||
indent: &'a str,
|
indent: &'a str,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "serde-json")]
|
#[cfg(feature = "serde_json")]
|
||||||
#[test]
|
#[test]
|
||||||
fn test_dynamic_json() {
|
fn test_dynamic_json() {
|
||||||
let val = json!({"arr": ["one", 2]});
|
let val = json!({"arr": ["one", 2]});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user