(class_file: &mut Classfile, class_name: &str)
| 268 | } |
| 269 | |
| 270 | fn class_const(class_file: &mut Classfile, class_name: &str) -> usize { |
| 271 | let utf8_idx = utf8_const(class_file, class_name); |
| 272 | for i in 0..class_file.constant_pool.constants.len() { |
| 273 | match class_file.constant_pool.constants[i] { |
| 274 | Constant::Class(ref idx) => { |
| 275 | if idx.idx == utf8_idx { |
| 276 | return i; |
| 277 | } |
| 278 | }, |
| 279 | _ => () |
| 280 | } |
| 281 | } |
| 282 | let ret = class_file.constant_pool.constants.len(); |
| 283 | class_file.constant_pool.constants.push(Constant::Class(ConstantPoolIndex { idx: utf8_idx })); |
| 284 | return ret; |
| 285 | } |
| 286 | |
| 287 | #[allow(dead_code)] |
| 288 | fn name_and_type_const(class_file: &mut Classfile, name: &str, desc: &str) -> usize { |
no test coverage detected