Move definition of Array and Map to lib.rs.

This commit is contained in:
Stephen Chung
2020-11-16 21:14:32 +08:00
parent adb902326e
commit d50d48f26f
12 changed files with 50 additions and 65 deletions

View File

@@ -28,20 +28,14 @@ use crate::stdlib::{
string::{String, ToString},
};
/// Variable-sized array of `Dynamic` values.
///
/// Not available under the `no_index` feature.
#[cfg(not(feature = "no_index"))]
pub type Array = crate::stdlib::vec::Vec<Dynamic>;
use crate::Array;
#[cfg(not(feature = "no_index"))]
pub const TYPICAL_ARRAY_SIZE: usize = 8; // Small arrays are typical
/// Hash map of `Dynamic` values with `ImmutableString` keys.
///
/// Not available under the `no_object` feature.
#[cfg(not(feature = "no_object"))]
pub type Map = HashMap<ImmutableString, Dynamic>;
use crate::Map;
#[cfg(not(feature = "no_object"))]
pub const TYPICAL_MAP_SIZE: usize = 8; // Small maps are typical