pub fn diff_labels(declared: &[LabelSpec], remote: &[RemoteLabel]) -> LabelDiffExpand description
Compute the diff between the user’s declared label set and the
labels currently on the upstream remote. Pure function — no I/O,
no observable side effects (allocates a transient HashMap and
HashSet to index by name, plus the returned LabelDiff).
Comparison rules:
- Name is the unique key. Matching is byte-exact (including
whitespace), since GitHub treats
bugandBugas different. - Color is lowercased on both sides before comparing — defence
in depth on top of
crate::github::parse_labels_json, which already lowercases remote colours, so a manually-constructedRemoteLabel(e.g. from a test fixture) with uppercase hex doesn’t slip through as a spurious “update”. - Description:
NoneandSome("")are equivalent (GitHub stores them interchangeably).