- macro_rules! impl_const {
- ($name:ident) => {
- if let Some(want) = args.$name {
- code = quote! {
- mt_ser::MtDeserialize::mt_deserialize::<mt_ser::DefCfg>(__reader)
- .and_then(|got| {
- if #want == got {
- #code
- } else {
- Err(mt_ser::DeserializeError::InvalidConst(
- #want as u64, got as u64
- ))
- }
- })
- };
- }
- };
- }
-
- impl_const!(const64);
- impl_const!(const32);
- impl_const!(const16);
- impl_const!(const8);
-