#![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::{HashSet, hset};
#[ derive( Debug, PartialEq, former::Former ) ]
pub struct StructWithSet {
#[ subform_collection( definition = former::HashSetDefinition ) ]
set: HashSet<&'static str>,
}
let instance = StructWithSet::former().set().add("apple").add("banana").end().form();
assert_eq!(
instance,
StructWithSet {
set: hset!["apple", "banana"]
}
);
dbg!(instance);
}