Replace deprecated MacroInput
This commit is contained in:
parent
c0a06bdc96
commit
c52e131a03
@ -7,7 +7,7 @@ use internals::{self, attr};
|
||||
|
||||
use std::iter;
|
||||
|
||||
pub fn expand_derive_deserialize(item: &syn::MacroInput) -> Result<Tokens, String> {
|
||||
pub fn expand_derive_deserialize(item: &syn::DeriveInput) -> Result<Tokens, String> {
|
||||
let item = {
|
||||
let ctxt = internals::Ctxt::new();
|
||||
let item = Item::from_ast(&ctxt, item);
|
||||
|
@ -21,7 +21,7 @@ mod ser;
|
||||
|
||||
#[proc_macro_derive(Serialize, attributes(serde))]
|
||||
pub fn derive_serialize(input: TokenStream) -> TokenStream {
|
||||
let input = syn::parse_macro_input(&input.to_string()).unwrap();
|
||||
let input = syn::parse_derive_input(&input.to_string()).unwrap();
|
||||
match ser::expand_derive_serialize(&input) {
|
||||
Ok(expanded) => expanded.parse().unwrap(),
|
||||
Err(msg) => panic!(msg),
|
||||
@ -30,7 +30,7 @@ pub fn derive_serialize(input: TokenStream) -> TokenStream {
|
||||
|
||||
#[proc_macro_derive(Deserialize, attributes(serde))]
|
||||
pub fn derive_deserialize(input: TokenStream) -> TokenStream {
|
||||
let input = syn::parse_macro_input(&input.to_string()).unwrap();
|
||||
let input = syn::parse_derive_input(&input.to_string()).unwrap();
|
||||
match de::expand_derive_deserialize(&input) {
|
||||
Ok(expanded) => expanded.parse().unwrap(),
|
||||
Err(msg) => panic!(msg),
|
||||
|
@ -5,7 +5,7 @@ use bound;
|
||||
use internals::ast::{Body, Field, Item, Style, Variant};
|
||||
use internals::{self, attr};
|
||||
|
||||
pub fn expand_derive_serialize(item: &syn::MacroInput) -> Result<Tokens, String> {
|
||||
pub fn expand_derive_serialize(item: &syn::DeriveInput) -> Result<Tokens, String> {
|
||||
let ctxt = internals::Ctxt::new();
|
||||
let item = Item::from_ast(&ctxt, item);
|
||||
try!(ctxt.check());
|
||||
|
Loading…
Reference in New Issue
Block a user