Commit 0f6d2256 authored by Tamir Duberstein's avatar Tamir Duberstein Committed by Miguel Ojeda
Browse files

rust: str: remove unnecessary qualification



`core::ffi::*` is in the prelude, which is imported here.

Signed-off-by: default avatarTamir Duberstein <tamird@gmail.com>
Reviewed-by: default avatarBenno Lossin <lossin@kernel.org>
Reviewed-by: default avatarAlice Ryhl <aliceryhl@google.com>
Link: https://lore.kernel.org/r/20250704-core-cstr-prepare-v1-4-a91524037783@gmail.com


Signed-off-by: default avatarMiguel Ojeda <ojeda@kernel.org>
parent 386f285d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -232,7 +232,7 @@ pub const fn is_empty(&self) -> bool {
    /// last at least `'a`. When `CStr` is alive, the memory pointed by `ptr`
    /// must not be mutated.
    #[inline]
    pub unsafe fn from_char_ptr<'a>(ptr: *const crate::ffi::c_char) -> &'a Self {
    pub unsafe fn from_char_ptr<'a>(ptr: *const c_char) -> &'a Self {
        // SAFETY: The safety precondition guarantees `ptr` is a valid pointer
        // to a `NUL`-terminated C string.
        let len = unsafe { bindings::strlen(ptr) } + 1;
@@ -295,7 +295,7 @@ pub unsafe fn from_bytes_with_nul_unchecked_mut(bytes: &mut [u8]) -> &mut CStr {

    /// Returns a C pointer to the string.
    #[inline]
    pub const fn as_char_ptr(&self) -> *const crate::ffi::c_char {
    pub const fn as_char_ptr(&self) -> *const c_char {
        self.0.as_ptr()
    }