]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
rust: vmstate: use "cast()" instead of "as"
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 17 Sep 2025 10:40:29 +0000 (12:40 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 22 Sep 2025 15:17:18 +0000 (17:17 +0200)
Reported by clippy, fix it.

Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
rust/migration/src/vmstate.rs

index c05c4a1fd66589abb26aa787af74df18cefba46e..e04b19b3c9f310b18f19779caadbc9e81d318f1e 100644 (file)
@@ -144,7 +144,7 @@ macro_rules! vmstate_of {
         $crate::bindings::VMStateField {
             name: ::core::concat!(::core::stringify!($field_name), "\0")
                 .as_bytes()
-                .as_ptr() as *const ::std::os::raw::c_char,
+                .as_ptr().cast::<::std::os::raw::c_char>(),
             offset: ::std::mem::offset_of!($struct_name, $field_name),
             $(num_offset: ::std::mem::offset_of!($struct_name, $num),)?
             $(field_exists: $crate::vmstate_exist_fn!($struct_name, $test_fn),)?