(class_file: &mut Classfile, str: &str)
| 234 | } |
| 235 | |
| 236 | fn utf8_const(class_file: &mut Classfile, str: &str) -> usize { |
| 237 | for i in 0..class_file.constant_pool.constants.len() { |
| 238 | match class_file.constant_pool.constants[i] { |
| 239 | Constant::Utf8(ref bytes) => { |
| 240 | if bytes.as_slice() == str.as_bytes() { |
| 241 | return i; |
| 242 | } |
| 243 | }, |
| 244 | _ => () |
| 245 | } |
| 246 | } |
| 247 | let ret = class_file.constant_pool.constants.len(); |
| 248 | class_file.constant_pool.constants.push(Constant::Utf8(str.as_bytes().to_vec())); |
| 249 | return ret; |
| 250 | } |
| 251 | |
| 252 | #[allow(dead_code)] |
| 253 | fn str_const(class_file: &mut Classfile, str: &str) -> usize { |
no test coverage detected