INNER CODE UNIT · Rust

extract_labels

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

pub fn extract_labels<T: Metadata<Ty = ObjectMeta>>(obj: &T) -> Option<Cow<'_, str>> {
    let meta = obj.metadata();
    meta.labels
        .as_ref()
        .map(|labels| keyval_string(labels.iter(), None).into())
}

// utility functions
fn row_matches(row: &[CellSpec<'_>], regex: &Regex) -> bool {
    let mut has_match = false;
    for cell_spec in row.iter() {
        if !has_match {
            has_match = cell_spec.matches(regex);
        }
    }
    has_match
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…