diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2018-01-08 23:54:35 +0100 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2018-01-09 21:41:45 +0100 |
commit | b787bb4aee6c2cad0c66ded874d5f37b8e4b0413 (patch) | |
tree | 3d090a051a3eec5813043a94519e6366135f63dd /askama_derive | |
parent | b8c261c8bb1ef55946dac6e06b900d83f5fabaea (diff) | |
download | askama-b787bb4aee6c2cad0c66ded874d5f37b8e4b0413.tar.gz askama-b787bb4aee6c2cad0c66ded874d5f37b8e4b0413.tar.bz2 askama-b787bb4aee6c2cad0c66ded874d5f37b8e4b0413.zip |
Upgrade to syn-0.12 and quote-0.4
Diffstat (limited to 'askama_derive')
-rw-r--r-- | askama_derive/Cargo.toml | 2 | ||||
-rw-r--r-- | askama_derive/src/lib.rs | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/askama_derive/Cargo.toml b/askama_derive/Cargo.toml index a6c633a..f0a8331 100644 --- a/askama_derive/Cargo.toml +++ b/askama_derive/Cargo.toml @@ -18,4 +18,4 @@ rocket = ["askama_shared/rocket"] [dependencies] askama_shared = { version = "0.5.0", path = "../askama_shared" } -syn = "0.11" +syn = "0.12" diff --git a/askama_derive/src/lib.rs b/askama_derive/src/lib.rs index 012ad65..7c92fdc 100644 --- a/askama_derive/src/lib.rs +++ b/askama_derive/src/lib.rs @@ -6,9 +6,9 @@ use proc_macro::TokenStream; #[proc_macro_derive(Template, attributes(template))] pub fn derive_template(input: TokenStream) -> TokenStream { - let ast = syn::parse_derive_input(&input.to_string()).unwrap(); - match ast.body { - syn::Body::Struct(ref data) => data, + let ast: syn::DeriveInput = syn::parse(input).unwrap(); + match ast.data { + syn::Data::Struct(ref data) => data, _ => panic!("#[derive(Template)] can only be used with structs"), }; shared::build_template(&ast).parse().unwrap() |