(
ctx: &mut ScriptContext<'_, API>,
root_id: NodeID,
idx: usize,
)
| 417 | let cache = INSPECTOR_ROW_TEMPLATES.get_or_init(|| Mutex::new(Vec::new())); |
| 418 | let Ok(mut guard) = cache.lock() else { |
| 419 | return; |
| 420 | }; |
| 421 | while guard.len() <= idx { |
| 422 | guard.push(None); |
| 423 | } |
| 424 | guard[idx] = template; |
| 425 | } |
| 426 | |
| 427 | fn rename_value_row<API: ScriptAPI + ?Sized>( |
| 428 | ctx: &mut ScriptContext<'_, API>, |
| 429 | root_id: NodeID, |
| 430 | idx: usize, |
| 431 | ) { |
| 432 | let mut stack = vec![root_id]; |
| 433 | while let Some(id) = stack.pop() { |
| 434 | if let Some(children) = ctx.run.Nodes().get_node_children_ids(id) { |
| 435 | stack.extend(children); |
| 436 | } |
| 437 | let Some(name) = ctx |
| 438 | .run |
| 439 | .Nodes() |
| 440 | .get_node_name(id) |
| 441 | .map(|name| name.to_string()) |
| 442 | else { |
| 443 | continue; |
| 444 | }; |
| 445 | let next = match value_row_instance_name(&name, idx) { |
| 446 | Some(next) => next, |
no test coverage detected