Skip to main content

sort_array_by_key

Function sort_array_by_key 

Source
pub fn sort_array_by_key(arr: &mut [Value], key: &str)
Expand description

Sort an array of objects in place by the given top-level key. Non-objects, or objects missing the key, sort to the end in stable upstream order. Tie-broken by the JSON serialization of the entry, so equal-key entries are still deterministic.