Skip to content

Commit

Permalink
Corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
ilslv committed Jul 14, 2023
1 parent efc860b commit 7a4de17
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/into.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ use alloc::{
string::{String, ToString},
};
#[cfg(feature = "std")]
use std::{borrow::Cow, mem};
use std::borrow::Cow;

use derive_more::Into;
use static_assertions::assert_not_impl_any;

/// [`mem::transmute()`] that works in generic contexts.
unsafe fn transmute<From, To>(from: From) -> To {
use core::mem;

let to = unsafe { mem::transmute_copy(&from) };
mem::forget(from);
to
Expand Down

0 comments on commit 7a4de17

Please sign in to comment.