bin/ui: Simplify impl of ui::format::labels()

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
Matthias Beyer
2025-12-09 13:16:57 +01:00
committed by Erik Kundt
parent f5af55472e
commit 8aeffe61ff
+5 -11
View File
@@ -55,17 +55,11 @@ pub fn patch_state(state: &patch::State) -> (String, Color) {
}
pub fn labels(labels: &[Label]) -> String {
let mut output = String::new();
let mut labels = labels.iter().peekable();
while let Some(label) = labels.next() {
output.push_str(&label.to_string());
if labels.peek().is_some() {
output.push_str(", ");
}
}
output
labels
.iter()
.map(|l| l.name())
.collect::<Vec<_>>()
.join(", ")
}
pub fn author(did: &Did, alias: &Option<Alias>, is_you: bool) -> String {