INNER CODE UNIT · Rust
expect_lit
c3rb3ru5d3d53c/binlex · crates/libvex/libvex-macros/src/lib.rs:439
fn expect_lit(self) -> syn::Result<LitInt> {
match self {
Self::Int(lit) => Ok(lit),
_ => panic!(),
}
}
}
impl Parse for AbiArg {
fn parse(input: ParseStream) -> Result<Self> {
let lookahead = input.lookahead1();
if lookahead.peek(LitInt) {
input.parse().map(Self::Int)
} else {
input.parse().map(Self::Expr)
}
}
}