INNER CODE UNIT · Rust
uppercase_first
databricks/click · src/command/mod.rs:168
pub fn uppercase_first(s: &str) -> String {
let mut cs = s.chars();
match cs.next() {
None => String::new(),
Some(f) => f.to_uppercase().collect::<String>() + cs.as_str(),
}
}
// table printing / building
/* this function abstracts the standard handling code for when a k8s call returns a list of objects.
* it does the following thins:
* - builds the row specs based on the passed extractors/regex
* - gets the kobks from each listable object
* -- sets the env to have the built list as its current list
* -- clears the env list if the built list was empty
*
* NB: This function assumes you want the printed list to be numbered. It further assumes the cols
* will NOT include a colume named ####, and inserts it for you at the start.