rhai/src/stdlib.rs

29 lines
806 B
Rust
Raw Normal View History

2020-03-18 03:50:51 +01:00
//! Helper module which defines most of the needed features from `std` for `no-std` builds.
#[cfg(feature = "no_std")]
2020-03-17 19:26:11 +01:00
mod inner {
pub use core::{
any, arch, array, ascii, cell, char, clone, cmp, convert, default, f32, f64, ffi, fmt,
2020-06-17 10:50:46 +02:00
future, hash, hint, i16, i32, i64, i8, isize, iter, marker, mem, num, ops, option, panic,
pin, prelude, ptr, result, slice, str, task, time, u16, u32, u64, u8, usize,
2020-03-17 19:26:11 +01:00
};
2020-06-17 10:50:46 +02:00
#[cfg(not(target_arch = "wasm32"))]
pub use core::{i128, u128};
pub use alloc::{borrow, boxed, format, rc, string, sync, vec};
2020-03-17 19:26:11 +01:00
pub use core_error as error;
pub mod collections {
pub use hashbrown::{hash_map, hash_set, HashMap, HashSet};
2020-03-17 19:26:11 +01:00
}
}
#[cfg(not(feature = "no_std"))]
2020-03-17 19:26:11 +01:00
mod inner {
pub use std::*;
}
pub use self::inner::*;