diff options
| author | Paolo Bonzini <pbonzini@redhat.com> | 2024-11-24 18:51:34 +0100 |
|---|---|---|
| committer | Paolo Bonzini <pbonzini@redhat.com> | 2024-12-11 15:57:19 +0100 |
| commit | 166e8a1fd15bfa527b25fc15ca315e572c0556d2 (patch) | |
| tree | d72f812798ea3ded3bda9130b0469175f49d3381 /rust/qemu-api/tests/tests.rs | |
| parent | 7bd8e3ef63330e870cf4644d21c285cce35c703d (diff) | |
| download | focaccia-qemu-166e8a1fd15bfa527b25fc15ca315e572c0556d2.tar.gz focaccia-qemu-166e8a1fd15bfa527b25fc15ca315e572c0556d2.zip | |
rust: qom: change the parent type to an associated type
Avoid duplicated code to retrieve the QOM type strings from the Rust type. Reviewed-by: Zhao Liu <zhao1.liu@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'rust/qemu-api/tests/tests.rs')
| -rw-r--r-- | rust/qemu-api/tests/tests.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/rust/qemu-api/tests/tests.rs b/rust/qemu-api/tests/tests.rs index 1d027dd652..278efe967f 100644 --- a/rust/qemu-api/tests/tests.rs +++ b/rust/qemu-api/tests/tests.rs @@ -48,8 +48,7 @@ fn test_device_decl_macros() { } impl ObjectImpl for DummyState { - const PARENT_TYPE_NAME: Option<&'static CStr> = - Some(<DeviceState as ObjectType>::TYPE_NAME); + type ParentType = DeviceState; const ABSTRACT: bool = false; } |