mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -06:00
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>
This commit is contained in:
parent
4cb7040d85
commit
c48700e86d
3 changed files with 6 additions and 5 deletions
|
@ -2,10 +2,10 @@
|
||||||
// Author(s): Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
|
// Author(s): Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
use core::ptr::{addr_of, addr_of_mut, NonNull};
|
|
||||||
use std::{
|
use std::{
|
||||||
ffi::CStr,
|
ffi::CStr,
|
||||||
os::raw::{c_int, c_void},
|
os::raw::{c_int, c_void},
|
||||||
|
ptr::{addr_of, addr_of_mut, NonNull},
|
||||||
};
|
};
|
||||||
|
|
||||||
use qemu_api::{
|
use qemu_api::{
|
||||||
|
|
|
@ -2,8 +2,10 @@
|
||||||
// Author(s): Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
|
// Author(s): Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
use core::ptr::NonNull;
|
use std::{
|
||||||
use std::os::raw::{c_int, c_void};
|
os::raw::{c_int, c_void},
|
||||||
|
ptr::NonNull,
|
||||||
|
};
|
||||||
|
|
||||||
use qemu_api::{
|
use qemu_api::{
|
||||||
bindings::*, c_str, prelude::*, vmstate_clock, vmstate_fields, vmstate_of, vmstate_struct,
|
bindings::*, c_str, prelude::*, vmstate_clock, vmstate_fields, vmstate_of, vmstate_struct,
|
||||||
|
|
|
@ -4,8 +4,7 @@
|
||||||
|
|
||||||
//! Bindings for interrupt sources
|
//! Bindings for interrupt sources
|
||||||
|
|
||||||
use core::ptr;
|
use std::{ffi::CStr, marker::PhantomData, os::raw::c_int, ptr};
|
||||||
use std::{ffi::CStr, marker::PhantomData, os::raw::c_int};
|
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
bindings::{self, qemu_set_irq},
|
bindings::{self, qemu_set_irq},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue