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
226226 {" verb" : " DO NOT RUN" }
227227 ]);
228228
229- let path = json . query_only_path (" $. [?(@.verb == 'RUN')]" )? ;
229+ let path = json . query_only_path (" $[?(@.verb == 'RUN')]" )? ;
230230 let elem = path . first (). unwrap_or_default ();
231231
232232 if let Some (v ) = json
Original file line number Diff line number Diff line change @@ -170,14 +170,16 @@ mod tests {
170170 ],
171171 "expensive": 10 }"#
172172 }
173+
174+ #[ test]
173175 fn update_by_path_test ( ) -> Queried < ( ) > {
174176 let mut json = json ! ( [
175177 { "verb" : "RUN" , "distance" : [ 1 ] } ,
176178 { "verb" : "TEST" } ,
177179 { "verb" : "DO NOT RUN" }
178180 ] ) ;
179181
180- let path = json. query_only_path ( "$. [?(@.verb == 'RUN')]" ) ?;
182+ let path = json. query_only_path ( "$[?(@.verb == 'RUN')]" ) ?;
181183 let elem = path. first ( ) . cloned ( ) . unwrap_or_default ( ) ;
182184
183185 if let Some ( v) = json
You can’t perform that action at this time.
0 commit comments