Skip to content

Commit 8a2eceb

Browse files
committed
fix: Use core instead of std where it is possible
1 parent f16c939 commit 8a2eceb

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/error.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Opaque pointers errors.
22
3-
use std::str::Utf8Error;
3+
use core::str::Utf8Error;
44

55
/// Errors that can be detected by the functions of this crate.
66
///
@@ -16,8 +16,8 @@ pub enum PointerError {
1616
Utf8Error(Utf8Error),
1717
}
1818

19-
impl std::fmt::Display for PointerError {
20-
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19+
impl core::fmt::Display for PointerError {
20+
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
2121
match *self {
2222
Self::Null => {
2323
write!(f, "dereference a null pointer will produce a crash")

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ pub fn raw<T>(data: T) -> *mut T {
9595
#[cfg(any(feature = "alloc", feature = "std"))]
9696
#[inline]
9797
pub unsafe fn free<T>(pointer: *mut T) {
98-
std::mem::drop(own_back(pointer));
98+
core::mem::drop(own_back(pointer));
9999
}
100100

101101
/// Opposite of [`raw<T>()`], to use Rust's ownership as usually.

0 commit comments

Comments
 (0)