Format with rustfmt 0.99.2
This commit is contained in:
parent
55cecace29
commit
d23a40c1bb
@ -27,7 +27,10 @@ pub fn expand_derive_serialize(input: &syn::DeriveInput) -> Result<TokenStream,
|
||||
let params = Parameters::new(&cont);
|
||||
let (impl_generics, ty_generics, where_clause) = params.generics.split_for_impl();
|
||||
let suffix = ident.to_string().trim_left_matches("r#").to_owned();
|
||||
let dummy_const = Ident::new(&format!("_IMPL_SERIALIZE_FOR_{}", suffix), Span::call_site());
|
||||
let dummy_const = Ident::new(
|
||||
&format!("_IMPL_SERIALIZE_FOR_{}", suffix),
|
||||
Span::call_site(),
|
||||
);
|
||||
let body = Stmts(serialize_body(&cont, ¶ms));
|
||||
|
||||
let impl_block = if let Some(remote) = cont.attrs.remote() {
|
||||
|
@ -13,15 +13,17 @@ fn test_raw_identifiers() {
|
||||
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
||||
#[allow(non_camel_case_types)]
|
||||
enum r#type {
|
||||
r#type {
|
||||
r#type: (),
|
||||
}
|
||||
r#type { r#type: () },
|
||||
}
|
||||
|
||||
assert_tokens(
|
||||
&r#type::r#type { r#type: () },
|
||||
&[
|
||||
Token::StructVariant { name: "type", variant: "type", len: 1 },
|
||||
Token::StructVariant {
|
||||
name: "type",
|
||||
variant: "type",
|
||||
len: 1,
|
||||
},
|
||||
Token::Str("type"),
|
||||
Token::Unit,
|
||||
Token::StructVariantEnd,
|
||||
|
Loading…
x
Reference in New Issue
Block a user