mod tuple;
pub use tuple::*;
#[cfg(feature = "std")]
mod string;
#[cfg(feature = "std")]
pub use string::*;
mod u4;
pub use u4::*;
mod u2;
pub use u2::*;
mod u1;
pub use u1::*;
mod small_u_support;
mod math;
pub use math::*;
mod cell;
pub use cell::*;
mod error;
pub use error::*;
#[cfg(feature = "std")]
mod repeat;
#[cfg(feature = "std")]
pub use repeat::*;
#[cfg(feature = "std")]
mod lists;
#[cfg(feature = "std")]
pub use lists::*;
pub const trait SetToDefault {
fn restore_default(&mut self);
}
impl<T: Default> SetToDefault for T {
fn restore_default(&mut self) {
*self = core::default::Default::default();
}
}
pub mod range;
pub use range::*;
mod conversion;
pub use conversion::*;
mod macro_fun;
mod char;
pub use char::*;
pub const trait LogToConsole: LogToConsoleHelper {
fn println_self(&self);
fn print_self(&self);
}
pub const trait LogToConsoleHelper {
fn println_self_prefixed(&self, prefix: &str);
fn println_self_suffixed(&self, suffix: &str);
}
#[cfg(feature = "std")]
impl<T: LogToConsole + core::fmt::Debug> LogToConsoleHelper for T {
fn println_self_prefixed(&self, prefix: &str) {
String::println_self(&format!("{prefix}{self:?}"));
}
fn println_self_suffixed(&self, suffix: &str) {
String::println_self(&format!("{self:?}{suffix}"));
}
}
#[cfg(feature = "std")]
impl<T: core::fmt::Debug> LogToConsole for T {
fn println_self(&self) {
println!("{self:?}");
}
fn print_self(&self) {
print!("{self:?}");
}
}
mod panic;
pub use panic::*;
#[macro_export]
macro_rules! impl_default {
($t:ty, $v:expr, $doc:tt) => {
impl const Default for $t {
#[inline(always)]
#[doc = $doc]
fn default() -> $t {
$v
}
}
};
($t:ty, $v:expr) => {
impl const Default for $t {
#[inline(always)]
fn default() -> $t {
$v
}
}
};
}