Skip to content

Commit

Permalink
Update to address PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
jshearer committed Oct 27, 2023
1 parent 4ae50a5 commit 9864f9a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
7 changes: 3 additions & 4 deletions crates/doc/src/ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,7 @@ impl Pointer {
arr.last_mut().unwrap()
}
// Cannot match (attempt to query property of an array).
Token::Property(_) => return None,
Token::NextProperty => return None,
Token::Property(_) | Token::NextProperty => return None,
},
Value::Number(_) | Value::Bool(_) | Value::String(_) => {
return None; // Cannot match (attempt to take child of scalar).
Expand Down Expand Up @@ -275,8 +274,7 @@ impl Pointer {
arr.last_mut().unwrap()
}
// Cannot match (attempt to query property of an array).
Token::Property(_) => return None,
Token::NextProperty => return None,
Token::Property(_) | Token::NextProperty => return None,
},
HeapNode::Bool(_)
| HeapNode::Bytes(_)
Expand Down Expand Up @@ -517,6 +515,7 @@ mod test {
for case in [
"/foo/2/a/3", // Attempt to index string scalar.
"/foo/bar", // Attempt to take property of array.
"/foo/-", // Attempt to take property of array
]
.iter()
{
Expand Down
4 changes: 1 addition & 3 deletions crates/doc/src/shape/limits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ fn squash_location_inner(shape: &mut Shape, name: &Token) {
match name {
// Squashing of `additional*` fields is not possible here because we don't
// have access to the parent shape
Token::NextIndex => unreachable!(),
Token::NextProperty => unreachable!(),

Token::NextIndex | Token::NextProperty => unreachable!(),
Token::Index(_) => {
// Pop the last element from the array tuple shape to avoid
// shifting the indexes of any other tuple shapes
Expand Down

0 comments on commit 9864f9a

Please sign in to comment.