Skip to main content

compute_key_index

Function compute_key_index 

Source
pub fn compute_key_index(rows: &[Row]) -> Vec<String>
Expand description

Computes the stable first-seen column order across all rows.

ยงExamples

use osp_cli::core::output_model::compute_key_index;
use osp_cli::row;

let rows = vec![
    row! { "uid" => "alice", "mail" => "a@example.com" },
    row! { "uid" => "bob", "cn" => "Bob" },
];

assert_eq!(compute_key_index(&rows), vec!["uid", "mail", "cn"]);