Skip to content

Commit e4e1c22

Browse files
committed
Fix doctest
1 parent ef4bb4f commit e4e1c22

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

crates/rsonpath-lib/src/automaton.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ impl Automaton {
397397
/// use rsonpath::automaton::*;
398398
/// let path = "$.personal.details.contact.information.phones.home";
399399
/// let automation = Automaton::new(&rsonpath_syntax::parse(path).unwrap()).unwrap();
400-
/// let jsonpath_strings = automation.get_jsonpath_segments();
400+
/// let jsonpath_strings = automation.unquoted_jsonpath_segments();
401401
///
402402
/// println!("{:?}", jsonpath_strings); // ["personal", "details", "contact", "information", "phones", "home"]
403403
/// ```

crates/rsonpath-lib/src/engine/main.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,12 @@ impl MainEngine {
201201
/// # Example
202202
/// ```rust
203203
/// use rsonpath::automaton::*;
204+
/// use rsonpath::engine::RsonpathEngine;
205+
/// use crate::rsonpath::engine::Compiler;
204206
/// let path = "$.personal.details.contact.information.phones.home";
205207
/// let automation = Automaton::new(&rsonpath_syntax::parse(path).unwrap()).unwrap();
206-
/// let engine = RsonpathEngine::from_compiled_query(a);
207-
/// let jsonpath_strings = engine.get_jsonpath_segments();
208+
/// let engine = RsonpathEngine::from_compiled_query(automation);
209+
/// let jsonpath_strings = engine.unquoted_jsonpath_segments();
208210
///
209211
/// println!("{:?}", jsonpath_strings); // ["personal", "details", "contact", "information", "phones", "home"]
210212
/// ```

0 commit comments

Comments
 (0)