INNER CODE UNIT · Rust

idx

databricks/click · src/command/mod.rs:215

                let idx = index + 1; // +1 for #### col
                specs.sort_by(|a, b| a.1.get(idx).unwrap().cmp(b.1.get(idx).unwrap()));
            }
            None => clickwriteln!(
                writer,
                "Asked to sort by {}, but it's not a column in the output",
                colname
            ),
        }
    }

    let (kobjs, rows): (Vec<KObj>, Vec<RowSpec>) = if reverse {
        specs.into_iter().rev().unzip()
    } else {
        specs.into_iter().unzip()
    };

    let table = crate::table::print_table(titles, rows, env, writer);

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…