MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / cmp_id

Function cmp_id

nodedb/src/control/planner/descriptor_set.rs:103–105  ·  view source on GitHub ↗

Total-order comparison for `DescriptorId` since the cluster type does not derive `Ord` (only `Hash + Eq`). We define our own by `(kind discriminant, tenant_id, name)`.

(a: &DescriptorId, b: &DescriptorId)

Source from the content-addressed store, hash-verified

101/// type does not derive `Ord` (only `Hash + Eq`). We define our
102/// own by `(kind discriminant, tenant_id, name)`.
103fn cmp_id(a: &DescriptorId, b: &DescriptorId) -> std::cmp::Ordering {
104 (a.kind as u8, a.tenant_id, &a.name).cmp(&(b.kind as u8, b.tenant_id, &b.name))
105}
106
107#[cfg(test)]
108mod tests {

Callers 1

recordMethod · 0.85

Calls 1

cmpMethod · 0.45

Tested by

no test coverage detected