//! Generic constants for types from the [`alloc`] crate, including `String` and `Vec`.
//!
//! [`alloc`]: https://doc.rust-lang.org/alloc/
//!
use ;
/// An empty `Cow<'_, str>`. Usable to construct a `[Cow<'_, str>; N]`.
///
/// As of Rust 1.65.0, `[Cow::Borrowed(""); LEN]` is not valid,
/// because `Cow<'_, str>` isn't copy,
/// but `[COW_STR_NEW; LEN]` does work, like in the example below.
///
/// # Example
///
/// ```rust
/// use konst::alloc_type::COW_STR_NEW;
///
/// use std::borrow::Cow;
///
/// const SIX_COWS: [Cow<'_, str>; 6] = [COW_STR_NEW; 6];
///
/// let mut cows = SIX_COWS;
///
/// ('a'..='f')
/// .enumerate()
/// .filter(|(i, _)| i % 2 == 0 )
/// .for_each(|(i, c)|{
/// cows[i].to_mut().push(c)
/// });
///
/// assert_eq!(cows, ["a", "", "c", "", "e", ""])
///
/// ```
///
pub const COW_STR_NEW: = Borrowed;
/// An empty `String`. Usable to construct a `[String; N]`.
///
/// As of Rust 1.65.0, `[String::new(); LEN]` is not valid, because `String` isn't copy,
/// but `[STRING_NEW; LEN]` does work, like in the example below.
///
/// # Example
///
/// ```rust
/// use konst::alloc_type::STRING_NEW;
///
/// const STRINGS: [String; 3] = [STRING_NEW; 3];
///
/// let mut strings = STRINGS;
///
/// strings[0].push_str("foo");
/// strings[1].push_str("bar");
/// strings[2].push_str("baz");
///
/// assert_eq!(strings, ["foo", "bar", "baz"]);
///
///
/// ```
///
pub const STRING_NEW: String = String new;
declare_generic_const!
declare_generic_const!