From 8393ee2328a3d75b7398e2fa94ee3c6bffea1ce3 Mon Sep 17 00:00:00 2001 From: Trevor Hilton Date: Mon, 28 Aug 2023 21:10:46 -0400 Subject: [PATCH] clean up NodeList::get doc and use resolver 2 for workspace --- Cargo.toml | 1 + serde_json_path_core/src/node.rs | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5432177..080cdb5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,6 +5,7 @@ members = [ "serde_json_path_macros", "serde_json_path_macros/src/internal" ] +resolver = "2" [profile.dev] incremental = false diff --git a/serde_json_path_core/src/node.rs b/serde_json_path_core/src/node.rs index 915b98a..af1031a 100644 --- a/serde_json_path_core/src/node.rs +++ b/serde_json_path_core/src/node.rs @@ -163,10 +163,9 @@ impl<'a> NodeList<'a> { /// # fn main() -> Result<(), serde_json_path::ParseError> { /// let value = json!({"foo": ["bar", "biz", "bop"]}); /// let path = JsonPath::parse("$.foo.*")?; - /// let node = path.query(&value).get(1); - /// assert_eq!(node, Some(&json!("biz"))); - /// let node = path.query(&value).get(4); - /// assert!(node.is_none()); + /// let nodes = path.query(&value); + /// assert_eq!(nodes.get(1), Some(&json!("biz"))); + /// assert!(nodes.get(4).is_none()); /// # Ok(()) /// # } /// ```