You currently cannot use from_iter directly with a &[CompactString] for example. You have to do .into_iter().map(...) which is annoying. I ended up building my own helper function for this but it would be nicer if the heapless crate itself provided this generic impl.
This is my helper function:
pub fn build_hstring<const N: usize, I, S>(iter: I) -> heapless::String<N>
where
I: IntoIterator<Item = S>,
S: AsRef<str>,
{
let mut new = heapless::String::<N>::new();
for c in iter {
new.push_str(c.as_ref()).expect("build_hstring: capacity exceeded");
}
new
}