1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
use unidok_repr::ir::IrState; mod block; mod helpers; mod html; mod macros; mod segment; pub trait IntoNode<'a> { fn into_node(self, state: &IrState<'a>) -> crate::Node<'a>; } pub trait IntoNodes<'a> { fn into_nodes(self, state: &IrState<'a>) -> Vec<crate::Node<'a>>; } impl<'a, T: IntoNode<'a>> IntoNodes<'a> for Vec<T> { fn into_nodes(self, state: &IrState<'a>) -> Vec<crate::Node<'a>> { self.into_iter().map(|n| n.into_node(state)).collect() } }