Last active
November 24, 2020 13:16
-
-
Save DutchGhost/a0fc0846a9c43fb3fc460df7d583e067 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![no_std] | |
//#![no_implicit_prelude] | |
#[cfg(feature = "alloc")] | |
extern crate alloc; | |
#[cfg(feature = "std")] | |
extern crate std; | |
mod alloc { | |
#[cfg(not(feature = "std"))] | |
extern crate alloc; | |
#[cfg(not(feature = "std"))] | |
pub use alloc::boxed::Box; | |
#[cfg(feature = "std")] | |
pub use std::boxed::Box; | |
} | |
use { | |
::core, | |
}; | |
//#[macro_use] | |
pub mod debug { | |
#[macro_export] | |
macro_rules! dbg { | |
($($input:tt)*) => {{ | |
#[cfg(all(debug_assertions, feature = "std"))] | |
{ | |
::std::dbg!($($input)*) | |
} | |
#[cfg(not(debug_assertions))] | |
{ | |
$($input)* | |
} | |
}} | |
} | |
#[macro_use] | |
pub use crate::dbg; | |
} | |
#[cfg_attr(docs_rs, doc(cfg(feature = "alloc")))] | |
fn swap<T>(a: &'_ mut T, b: &'_ mut T) | |
-> () | |
where | |
T: Copy | |
{ | |
::core::mem::swap(a, b) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment