(text: &str, object: &str, node_type: &str)
| 293 | if !panim_frame_has_object(&out, 0, object) { |
| 294 | out = insert_panim_frame0_object(&out, object); |
| 295 | } |
| 296 | out |
| 297 | } |
| 298 | |
| 299 | pub fn insert_panim_object(text: &str, object: &str, node_type: &str) -> String { |
| 300 | if let Some(pos) = text.find("[/Objects]") { |
| 301 | let mut out = String::with_capacity(text.len() + object.len() + node_type.len() + 8); |
| 302 | out.push_str(&text[..pos]); |
| 303 | out.push_str(&format!("{object} = {node_type}\n")); |
| 304 | out.push_str(&text[pos..]); |
| 305 | return out; |
| 306 | } |
| 307 | format!("{text}\n[Objects]\n{object} = {node_type}\n[/Objects]\n") |
no test coverage detected