mirror of
https://seed.radicle.dev/rad:z39mP9rQAaGmERfUMPULfPUi473tY.git
synced 2026-11-15 16:00:38 +08:00
bin/ui: Simplify impl of ui::format::labels()
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
committed by
Erik Kundt
parent
f5af55472e
commit
8aeffe61ff
+5
-11
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user