Skip to content

Commit

Permalink
replace std with core
Browse files Browse the repository at this point in the history
  • Loading branch information
asmello committed Apr 3, 2024
1 parent 6595e74 commit 7232a1e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pointer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ unsafe fn extend_one_before(s: &str) -> &str {
let ptr = s.as_ptr().offset(-1);
let len = s.len() + 1;
let slice = slice::from_raw_parts(ptr, len);
std::str::from_utf8_unchecked(slice)
core::str::from_utf8_unchecked(slice)
}

const fn is_valid_ptr(value: &str) -> bool {
Expand Down Expand Up @@ -153,7 +153,7 @@ const fn is_valid_ptr(value: &str) -> bool {
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct Pointer(str);

impl std::fmt::Display for Pointer {
impl core::fmt::Display for Pointer {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
self.0.fmt(f)
}
Expand Down Expand Up @@ -565,7 +565,7 @@ impl Pointer {
}
} else {
// Pointer is root, we can replace `dest` directly
let replaced = std::mem::replace(dest, src.into());
let replaced = core::mem::replace(dest, src.into());
Ok(Assignment {
assigned: Cow::Borrowed(dest),
replaced,
Expand Down Expand Up @@ -682,7 +682,7 @@ impl<'a> IntoIterator for &'a Pointer {
/// An owned, mutable Pointer (akin to String).
///
/// This type provides methods like [`PointerBuf::push_back`] and [`PointerBuf::replace_token`] that
/// mutate the pointer in place. It also implements [`std::ops::Deref`] to [`Pointer`], meaning that
/// mutate the pointer in place. It also implements [`core::ops::Deref`] to [`Pointer`], meaning that
/// all methods on [`Pointer`] slices are available on `PointerBuf` values as well.
#[cfg_attr(
feature = "url",
Expand Down

0 comments on commit 7232a1e

Please sign in to comment.