1 2 3 4 5 6 7 8 9 10 11
use crate::{Parse, ParseResult, Parser};
use sway_ast::ItemFn;
impl Parse for ItemFn {
fn parse(parser: &mut Parser) -> ParseResult<ItemFn> {
let fn_signature = parser.parse()?;
let body = parser.parse()?;
Ok(ItemFn { fn_signature, body })
}
}