File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -226,7 +226,7 @@ The path is supported with the limited elements namely only the elements with th
226
226
{" verb" : " DO NOT RUN" }
227
227
]);
228
228
229
- let path = json . query_only_path (" $. [?(@.verb == 'RUN')]" )? ;
229
+ let path = json . query_only_path (" $[?(@.verb == 'RUN')]" )? ;
230
230
let elem = path . first (). unwrap_or_default ();
231
231
232
232
if let Some (v ) = json
Original file line number Diff line number Diff line change @@ -170,14 +170,16 @@ mod tests {
170
170
],
171
171
"expensive": 10 }"#
172
172
}
173
+
174
+ #[ test]
173
175
fn update_by_path_test ( ) -> Queried < ( ) > {
174
176
let mut json = json ! ( [
175
177
{ "verb" : "RUN" , "distance" : [ 1 ] } ,
176
178
{ "verb" : "TEST" } ,
177
179
{ "verb" : "DO NOT RUN" }
178
180
] ) ;
179
181
180
- let path = json. query_only_path ( "$. [?(@.verb == 'RUN')]" ) ?;
182
+ let path = json. query_only_path ( "$[?(@.verb == 'RUN')]" ) ?;
181
183
let elem = path. first ( ) . cloned ( ) . unwrap_or_default ( ) ;
182
184
183
185
if let Some ( v) = json
You can’t perform that action at this time.
0 commit comments