diff --git a/src/api/json.rs b/src/api/json.rs index b50749dc5..30f8d7f56 100644 --- a/src/api/json.rs +++ b/src/api/json.rs @@ -52,7 +52,7 @@ impl Engine { /// assert_eq!(map["b"].as_int().expect("b should exist"), 42); /// assert_eq!(map["d"].as_unit().expect("d should exist"), ()); /// - /// let c = map["c"].as_map().expect("c should exist"); + /// let c = map["c"].as_map_ref().expect("c should exist"); /// assert_eq!(c["x"].as_bool().expect("x should be bool"), false); /// assert_eq!(c["y"].as_bool().expect("y should be bool"), true); /// assert_eq!(c["z"].as_char().expect("z should be char"), '$'); diff --git a/src/serde/ser.rs b/src/serde/ser.rs index a0d7098b2..d314165fe 100644 --- a/src/serde/ser.rs +++ b/src/serde/ser.rs @@ -73,7 +73,7 @@ impl DynamicSerializer { /// assert!(value.is::()); /// /// let map = value.cast::(); -/// let point = map["d"].as_map().unwrap(); +/// let point = map["d"].as_map_ref().unwrap(); /// assert_eq!(*point["x"].read_lock::().unwrap(), 123.456); /// assert_eq!(*point["y"].read_lock::().unwrap(), 999.0); /// # } diff --git a/tests/parse_json.rs b/tests/parse_json.rs index 5786e26aa..08b1e7eaf 100644 --- a/tests/parse_json.rs +++ b/tests/parse_json.rs @@ -40,7 +40,7 @@ mod without_metadata { assert_eq!(map["age"].as_int().expect("age should exist"), 43); assert_eq!(map["phones"].clone().into_typed_array::().expect("phones should exist"), ["+44 1234567", "+44 2345678"]); - let address = map["address"].as_map().expect("address should exist"); + let address = map["address"].as_map_ref().expect("address should exist"); assert_eq!(address["city"].clone().into_immutable_string().expect("address.city should exist"), "London"); assert_eq!(address["street"].clone().into_immutable_string().expect("address.street should exist"), "10 Downing Street"); }