(&mut self, cp: &ConstantPool)
| 33 | } |
| 34 | |
| 35 | pub fn write_constant_pool(&mut self, cp: &ConstantPool) -> Result<usize, Error> { |
| 36 | cp.constants.iter().fold(self.write_u16(cp.cp_len() as u16), |acc, x| { |
| 37 | match acc { |
| 38 | Ok(ctr) => self.write_constant(x).map(|c| c + ctr), |
| 39 | err@_ => err |
| 40 | } |
| 41 | }) |
| 42 | } |
| 43 | |
| 44 | fn write_constant(&mut self, constant: &Constant) -> Result<usize, Error> { |
| 45 | match constant { |
no test coverage detected