Skip to content

Commit

Permalink
fix bugs related to no_std
Browse files Browse the repository at this point in the history
  • Loading branch information
anonrig committed Dec 9, 2024
1 parent 52482c9 commit f4337bc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion recapn/src/io/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ impl StreamTableRef {

#[inline]
pub fn segments(&self) -> &[SegmentLenReader] {
unsafe { &*(std::ptr::from_ref::<StreamTableRef>(self) as *const [SegmentLenReader]) }
unsafe { &*(core::ptr::from_ref::<StreamTableRef>(self) as *const [SegmentLenReader]) }
}

#[inline]
Expand Down
4 changes: 2 additions & 2 deletions recapn/src/ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ impl WirePtr {

impl<'a> From<&'a Word> for &'a WirePtr {
fn from(w: &'a Word) -> Self {
unsafe { &*std::ptr::from_ref::<Word>(w).cast::<WirePtr>() }
unsafe { &*core::ptr::from_ref::<Word>(w).cast::<WirePtr>() }
}
}

Expand Down Expand Up @@ -2178,7 +2178,7 @@ impl<'a> PtrReader<'a, Empty> {
pub const fn null() -> Self {
unsafe {
Self::new_unchecked(NonNull::new_unchecked(
std::ptr::from_ref(Word::null()).cast_mut(),
core::ptr::from_ref(Word::null()).cast_mut(),
))
}
}
Expand Down

0 comments on commit f4337bc

Please sign in to comment.