mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-06-13 09:01:01 +00:00
More efficient try!() alternative
This commit is contained in:
@@ -16,6 +16,7 @@ use bound;
|
||||
use fragment::{Expr, Fragment, Match, Stmts};
|
||||
use internals::ast::{Container, Data, Field, Style, Variant};
|
||||
use internals::{self, attr};
|
||||
use try;
|
||||
|
||||
use std::collections::BTreeSet;
|
||||
|
||||
@@ -63,10 +64,12 @@ pub fn expand_derive_deserialize(input: &syn::DeriveInput) -> Result<Tokens, Str
|
||||
}
|
||||
};
|
||||
|
||||
let try_replacement = try::replacement();
|
||||
let generated = quote! {
|
||||
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
|
||||
const #dummy_const: () = {
|
||||
extern crate serde as _serde;
|
||||
#try_replacement
|
||||
#impl_block
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user