MCPcopy Create free account
hub / github.com/cretz/stackparam / write_constant_pool

Method write_constant_pool

src/bytecode/io/writer.rs:35–42  ·  view source on GitHub ↗
(&mut self, cp: &ConstantPool)

Source from the content-addressed store, hash-verified

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 {

Callers 1

write_classMethod · 0.80

Calls 3

write_u16Method · 0.80
cp_lenMethod · 0.80
write_constantMethod · 0.80

Tested by

no test coverage detected