rust: Prefer std::ptr over core::ptr
PATCH 1/1 rust: Prefer 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 <[email protected]>
--- rust/hw/char/pl011/src/device.rs | 2 +- rust/hw/char/pl011/src/device_class.rs | 6 ++++-- rust/qemu-api/src/irq.rs | 3 +-- 3 files changed, 6 insertions(+), 5 deletions(-)
rust/hw/char/pl011/src/device.rs +1 -1
@@ -2,10 +2,10 @@// Author(s): Manos Pitsidianakis <[email protected]> // 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::{
rust/hw/char/pl011/src/device_class.rs +4 -2
@@ -2,8 +2,10 @@// Author(s): Manos Pitsidianakis <[email protected]> // 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,
rust/qemu-api/src/irq.rs +1 -2
@@ -4,8 +4,7 @@//! Bindings for interrupt sources -use core::ptr; -use std::{ffi::CStr , marker::PhantomData , os::raw::c_int}; +use std::{ffi::CStr , marker::PhantomData , os::raw::c_int, ptr};use crate ::{ bindings::{self, qemu_set_irq},
Signature · 1 line
2.34.1
Paolo Bonzini
AppliedQueued, thanks.
Paolo