codetether-agent 4.7.0-a-002.4

A2A-native AI coding agent for the CodeTether ecosystem
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use serde_json::Value;

pub fn get_mut_path<'a>(value: &'a mut Value, spec: &str) -> Option<&'a mut Value> {
    let mut current = value;
    for part in spec.split('.') {
        current = match current {
            Value::Object(map) => map.get_mut(part)?,
            Value::Array(items) => items.get_mut(part.parse::<usize>().ok()?)?,
            _ => return None,
        };
    }
    Some(current)
}