mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -06:00
rust: qom: convert type_info! macro to an associated const
type_info! is only used in the definition of ObjectImpl::TYPE_INFO, and in fact in all of them. Pull type_info!'s definition into the ObjectImpl trait, thus simplifying the external interface of qemu_api::definitions. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
93ea0896ea
commit
3701fb22df
3 changed files with 24 additions and 33 deletions
|
@ -55,7 +55,6 @@ fn test_device_decl_macros() {
|
|||
|
||||
impl ObjectImpl for DummyState {
|
||||
type Class = DummyClass;
|
||||
const TYPE_INFO: qemu_api::bindings::TypeInfo = qemu_api::type_info! { Self };
|
||||
const TYPE_NAME: &'static CStr = c_str!("dummy");
|
||||
const PARENT_TYPE_NAME: Option<&'static CStr> = Some(device_class::TYPE_DEVICE);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue