#![allow(missing_docs)]
#[cfg(not(all(
feature = "enabled",
feature = "derive_former",
any(feature = "use_alloc", not(feature = "no_std"))
)))]
fn main() {}
#[cfg(all(
feature = "enabled",
feature = "derive_former",
any(feature = "use_alloc", not(feature = "no_std"))
))]
fn main() {
use collection_tools::{HashMap, hmap};
#[ derive( Debug, PartialEq, former::Former ) ]
pub struct StructWithMap {
map: HashMap<&'static str, &'static str>,
}
let instance = StructWithMap::former().map(hmap! { "a" => "b", "c" => "d" }).form();
assert_eq!(
instance,
StructWithMap {
map: hmap! { "a" => "b", "c" => "d" }
}
);
dbg!(instance);
}