diff options
-rw-r--r-- | src/path/mod.rs | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/src/path/mod.rs b/src/path/mod.rs index b3773d1..cbf8350 100644 --- a/src/path/mod.rs +++ b/src/path/mod.rs @@ -78,44 +78,6 @@ impl Expression { } } - pub fn get_mut<'a>(&self, root: &'a mut Value) -> Option<&'a mut Value> { - match *self { - Self::Identifier(ref id) => match root.kind { - ValueKind::Table(ref mut map) => map.get_mut(id), - - _ => None, - }, - - Self::Child(ref expr, ref key) => match expr.get_mut(root) { - Some(value) => match value.kind { - ValueKind::Table(ref mut map) => map.get_mut(key), - - _ => None, - }, - - _ => None, - }, - - Self::Subscript(ref expr, index) => match expr.get_mut(root) { - Some(value) => match value.kind { - ValueKind::Array(ref mut array) => { - let index = sindex_to_uindex(index, array.len()); - - if index >= array.len() { - None - } else { - Some(&mut array[index]) - } - } - - _ => None, - }, - - _ => None, - }, - } - } - pub fn get_mut_forcibly<'a>(&self, root: &'a mut Value) -> Option<&'a mut Value> { match *self { Self::Identifier(ref id) => match root.kind { |