ic_stable_memory/utils/
mod.rs1#[doc(hidden)]
4pub mod certification;
5#[doc(hidden)]
6pub mod math;
7pub mod mem_context;
8#[cfg(test)]
9pub mod test;
10
11#[cfg(target_family = "wasm")]
12use ic_cdk::print;
13
14#[cfg(target_family = "wasm")]
15#[inline]
16pub fn isoprint(str: &str) {
17 print(str)
18}
19
20#[cfg(not(target_family = "wasm"))]
22#[inline]
23pub fn isoprint(str: &str) {
24 println!("{}", str)
25}
26
27pub trait DebuglessUnwrap<T> {
29 #[doc(hidden)]
30 fn debugless_unwrap(self) -> T;
31}
32
33impl<R, E> DebuglessUnwrap<R> for Result<R, E> {
34 fn debugless_unwrap(self) -> R {
35 match self {
36 Err(_) => panic!("Unwrapped a Result type without debug info"),
37 Ok(r) => r,
38 }
39 }
40}