#![doc(html_root_url="https://docs.rs/arrayvec/0.7/")]
#![cfg_attr(not(feature="std"), no_std)]
#[cfg(feature="serde")]
extern crate serde;
#[cfg(not(feature="std"))]
extern crate core as std;
#[cfg(not(target_pointer_width = "16"))]
pub(crate) type LenUint = u32;
#[cfg(target_pointer_width = "16")]
pub(crate) type LenUint = u16;
macro_rules! assert_capacity_limit {
($cap:expr) => {
if std::mem::size_of::<usize>() > std::mem::size_of::<LenUint>() {
if $cap > LenUint::MAX as usize {
#[cfg(not(target_pointer_width = "16"))]
panic!("ArrayVec: largest supported capacity is u32::MAX");
#[cfg(target_pointer_width = "16")]
panic!("ArrayVec: largest supported capacity is u16::MAX");
}
}
}
}
macro_rules! assert_capacity_limit_const {
($cap:expr) => {
if std::mem::size_of::<usize>() > std::mem::size_of::<LenUint>() {
if $cap > LenUint::MAX as usize {
[][$cap]
}
}
}
}
mod arrayvec;
mod array_string;
mod char;
mod errors;
mod utils;
pub use crate::array_string::ArrayString;
pub use crate::errors::CapacityError;
pub use crate::arrayvec::{ArrayVec, IntoIter, Drain};