spectec_ast_decode 1.0.0

Trait for decoding SpecTec AST S-expressions
Documentation
1
2
3
4
5
6
7
8
9
impl<T: crate::Decode> crate::Decode for Box<T> {
    fn decode<'a, I: Iterator<Item = &'a sexpr_parse::SExprItem>>(
        items: &mut std::iter::Peekable<I>,
    ) -> crate::Result<Self> {
        T::decode(items)
            .map(Self::new)
            .map_err(crate::Error::wrapped::<Self>)
    }
}