You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 1, 2023. It is now read-only.
Allows a the destructuring of a Json type with move semantics.
For example,
let json_value = Json::from_str("{}").unwrap();
let json_object = (|json: Json| {
json.as_object()
})(json_value);
assert!(json_object.is_some());
if a Json type is passed to a closure, or some other scope block, when
trying to destructure it, there is a lifetime conflict. The Json given
as a parameter to the closure was moved, but it cannot be moved out of
the closure as an Object. If you replace as_object with into_object, the
Object value returned is not a reference, so it can be moved out of the scope.
0 commit comments