diff options
author | Zhao Liu <zhao1.liu@intel.com> | 2025-02-18 16:08:35 +0800 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2025-02-25 16:18:11 +0100 |
commit | c48700e86d91004424e3a6496f194decb036dccb (patch) | |
tree | 09c583b9bad59f81771aeccb1affe5ce6142e4e3 /rust/hw | |
parent | 4cb7040d851cdd7b2622f83fd7d95a922225386b (diff) | |
download | qemu-c48700e86d91004424e3a6496f194decb036dccb.zip qemu-c48700e86d91004424e3a6496f194decb036dccb.tar.gz qemu-c48700e86d91004424e3a6496f194decb036dccb.tar.bz2 |
rust: prefer importing std::ptr over core::ptr
The std::ptr is same as core::ptr, but std has already been used in many
cases and there's no need to choose non-std library.
So, use std::ptr directly to make the used ptr library as consistent as
possible.
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Link: https://lore.kernel.org/r/20250218080835.3341082-1-zhao1.liu@intel.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'rust/hw')
-rw-r--r-- | rust/hw/char/pl011/src/device.rs | 2 | ||||
-rw-r--r-- | rust/hw/char/pl011/src/device_class.rs | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/rust/hw/char/pl011/src/device.rs b/rust/hw/char/pl011/src/device.rs index fe73771..59a689f 100644 --- a/rust/hw/char/pl011/src/device.rs +++ b/rust/hw/char/pl011/src/device.rs @@ -2,10 +2,10 @@ // Author(s): Manos Pitsidianakis <manos.pitsidianakis@linaro.org> // SPDX-License-Identifier: GPL-2.0-or-later -use core::ptr::{addr_of, addr_of_mut, NonNull}; use std::{ ffi::CStr, os::raw::{c_int, c_void}, + ptr::{addr_of, addr_of_mut, NonNull}, }; use qemu_api::{ diff --git a/rust/hw/char/pl011/src/device_class.rs b/rust/hw/char/pl011/src/device_class.rs index dbef93f..0b2076d 100644 --- a/rust/hw/char/pl011/src/device_class.rs +++ b/rust/hw/char/pl011/src/device_class.rs @@ -2,8 +2,10 @@ // Author(s): Manos Pitsidianakis <manos.pitsidianakis@linaro.org> // SPDX-License-Identifier: GPL-2.0-or-later -use core::ptr::NonNull; -use std::os::raw::{c_int, c_void}; +use std::{ + os::raw::{c_int, c_void}, + ptr::NonNull, +}; use qemu_api::{ bindings::*, c_str, prelude::*, vmstate_clock, vmstate_fields, vmstate_of, vmstate_struct, |