Skip to main content

sort_keys

Function sort_keys 

Source
pub fn sort_keys(value: &Value) -> Value
Expand description

Sort the keys of value (shallow) using the default UTF-16 ordering.

assert_eq!(sort_keys(&json!({ "b": 1, "a": 2 })), json!({ "a": 2, "b": 1 }));