(&mut self, fallback_idx: usize, action: F)
| 2078 | |
| 2079 | #[inline] |
| 2080 | fn on_decoder<F>(&mut self, fallback_idx: usize, action: F) -> Result<(), AvroError> |
| 2081 | where |
| 2082 | F: FnOnce(&mut Decoder) -> Result<(), AvroError>, |
| 2083 | { |
| 2084 | if let UnionReadPlan::ToSingle { target, .. } = &mut self.plan { |
| 2085 | return action(target); |
| 2086 | } |
| 2087 | let reader_idx = match &self.plan { |
| 2088 | UnionReadPlan::FromSingle { reader_idx, .. } => *reader_idx, |
| 2089 | _ => fallback_idx, |
| 2090 | }; |
| 2091 | self.branches.emit_to(reader_idx).and_then(action) |
| 2092 | } |
| 2093 | |
| 2094 | fn append_null(&mut self) -> Result<(), AvroError> { |
| 2095 | self.on_decoder(self.null_emit_idx, |decoder| decoder.append_null()) |
no test coverage detected