mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
rust/qemu-api-macros: normalize TryInto output
Remove extraneous `;` and add missing trailing comma to TryInto derive macro to match rustfmt style. We will add a test in the followup commit and we would like the inlined output in the test body to be properly formatted as well. No functional changes intended. Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org> Reviewed-by: Zhao Liu <zhao1.liu@intel.com> Link: https://lore.kernel.org/r/20250704-rust_add_derive_macro_unit_tests-v1-1-ebd47fa7f78f@linaro.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
committed by
Paolo Bonzini
parent
dab63b8a71
commit
c3a08c8dcb
@@ -199,7 +199,7 @@ fn derive_tryinto_body(
|
||||
let discriminants: Vec<&Ident> = variants.iter().map(|f| &f.ident).collect();
|
||||
|
||||
Ok(quote! {
|
||||
#(const #discriminants: #repr = #name::#discriminants as #repr;)*;
|
||||
#(const #discriminants: #repr = #name::#discriminants as #repr;)*
|
||||
match value {
|
||||
#(#discriminants => core::result::Result::Ok(#name::#discriminants),)*
|
||||
_ => core::result::Result::Err(value),
|
||||
@@ -227,7 +227,7 @@ fn derive_tryinto_or_error(input: DeriveInput) -> Result<proc_macro2::TokenStrea
|
||||
#body
|
||||
}) {
|
||||
Ok(x) => x,
|
||||
Err(_) => panic!(#errmsg)
|
||||
Err(_) => panic!(#errmsg),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user