(self, variant_index: u32)
| 237 | impl<'a> EncoderWrapper<'a> { |
| 238 | #[inline(always)] |
| 239 | fn serialize_enum(self, variant_index: u32) -> Result<EncoderWrapper<'a>> { |
| 240 | let variant_index = variant_index |
| 241 | .try_into() |
| 242 | .map_err(|_| error("enums with more than 256 variants are unsupported"))?; |
| 243 | let b = specify!(self, Enum); |
| 244 | b.0.encode(&variant_index); |
| 245 | let lazy = get_mut_or_resize(&mut b.1, variant_index as usize); |
| 246 | lazy.reserve_fast(1); // TODO use push instead. |
| 247 | Ok(Self { |
| 248 | lazy, |
| 249 | index_alloc: self.index_alloc, |
| 250 | }) |
| 251 | } |
| 252 | } |
| 253 | |
| 254 | macro_rules! impl_ser { |
no test coverage detected