1
Fork 0
This commit is contained in:
bjorn3 2025-02-08 22:12:13 +00:00
parent 3183b44a1e
commit 1fcae03369
287 changed files with 5888 additions and 4608 deletions

View file

@ -105,11 +105,14 @@ fn decodable_body(
};
s.underscore_const(true);
s.bound_impl(quote!(::rustc_serialize::Decodable<#decoder_ty>), quote! {
fn decode(__decoder: &mut #decoder_ty) -> Self {
#decode_body
}
})
s.bound_impl(
quote!(::rustc_serialize::Decodable<#decoder_ty>),
quote! {
fn decode(__decoder: &mut #decoder_ty) -> Self {
#decode_body
}
},
)
}
fn decode_field(field: &syn::Field) -> proc_macro2::TokenStream {
@ -285,13 +288,16 @@ fn encodable_body(
quote! {}
};
s.bound_impl(quote!(::rustc_serialize::Encodable<#encoder_ty>), quote! {
fn encode(
&self,
__encoder: &mut #encoder_ty,
) {
#lints
#encode_body
}
})
s.bound_impl(
quote!(::rustc_serialize::Encodable<#encoder_ty>),
quote! {
fn encode(
&self,
__encoder: &mut #encoder_ty,
) {
#lints
#encode_body
}
},
)
}

View file

@ -94,8 +94,8 @@ fn check_symbol_order() {
aardvark,
}
};
test_symbols_macro(input, &[
"Symbol `aardvark` must precede `zebra`",
"location of previous symbol `zebra`",
]);
test_symbols_macro(
input,
&["Symbol `aardvark` must precede `zebra`", "location of previous symbol `zebra`"],
);
}