fn labels_to_ids(labels: &Vec<Label>, is_vertex: bool) -> Option<Vec<LabelId>> {
    if labels.is_empty() {
        None
    } else {
        Some(
            labels
                .iter()
                .map(|label| match label {
                    Label::Str(s) => {
                        let label_id = if is_vertex {
                            (*GRAPH).get_schema().get_vertex_label_id(s)
                        } else {
                            (*GRAPH).get_schema().get_edge_label_id(s).map(|id| id)
                        };
                        label_id.unwrap_or(INVALID_LABEL_ID)
                    }
                    Label::Id(id) => *id,
                })
                .collect::<Vec<LabelId>>(),
        )
    }
}
/// Transform string-typed labels into a id-typed labels.
/// `is_true_label` records whether the label is an actual label, or already transformed into
/// an id-type.
Transform string-typed labels into a id-typed labels.
`is_true_label` records whether the label is an actual label, or already transformed into
an id-type.
Transform string - typed labels into a id - typed labels . ` is_true_label ` records whether the label is an actual label or already transformed into an id - type .
fn labels_to_ids(labels: &Vec<Label>, is_vertex: bool) -> Option<Vec<LabelId>> {
    if labels.is_empty() {
        None
    } else {
        Some(
            labels
                .iter()
                .map(|label| match label {
                    Label::Str(s) => {
                        let label_id = if is_vertex {
                            (*GRAPH).get_schema().get_vertex_label_id(s)
                        } else {
                            (*GRAPH).get_schema().get_edge_label_id(s).map(|id| id)
                        };
                        label_id.unwrap_or(INVALID_LABEL_ID)
                    }
                    Label::Id(id) => *id,
                })
                .collect::<Vec<LabelId>>(),
        )
    }
}
fn labels_to_ids ( labels : & Vec < Label > , is_vertex : bool ) -> Option < Vec < LabelId > > { if labels . is_empty ( ) { None } else { Some ( labels . iter ( ) . map ( | label | match label { Label :: Str ( s ) => { let label_id = if is_vertex { ( * GRAPH ) . get_schema ( ) . get_vertex_label_id ( s ) } else { ( * GRAPH ) . get_schema ( ) . get_edge_label_id ( s ) . map ( | id | id ) } ; label_id . unwrap_or ( INVALID_LABEL_ID ) } Label :: Id ( id ) => * id , } ) . collect :: < Vec < LabelId > > ( ) , ) } }
Transform string-typed labels into a id-typed labels.
Transform string - typed labels into a id - typed labels .
labels
&Vec<Label>
is_vertex
bool