Skip to main content

reorder_value

Function reorder_value 

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

Reorders values within value to conform to what toml 0.5 does.

This mirrors toml 0.5.11’s value.rs:412-439 (impl Serialize for Value::Table), and reorders items as:

  • plain values
  • then arrays of tables
  • then tables, recursively

toml 0.5 applies this reordering to Value trees only, not to structs or a directly serialized Table field, so callers are expected to only apply it in those cases.