use syn::{Attribute, Result};
pub(crate) fn parse_jsonrpc_code(attrs: &[Attribute]) -> Result<Option<i32>> {
for attr in attrs {
if attr.path().is_ident("jsonrpc_code") {
let lit: syn::LitInt = attr.parse_args()?;
let code: i32 = lit.base10_parse()?;
return Ok(Some(code));
}
}
Ok(None)
}