update clone button

This commit is contained in:
2026-08-29 08:39:04 +07:00
parent fc796582a8
commit 52f1606193
2 changed files with 166 additions and 17 deletions
+13
View File
@@ -1,3 +1,5 @@
use std::collections::HashSet;
use gpui::SharedString;
use nostr::prelude::*;
@@ -252,6 +254,17 @@ impl Announcement {
}
maintainers
}
/// The `git clone` URLs for this repository, deduplicated while
/// preserving the announced order (deterministic across calls).
pub fn clone_urls(&self) -> Vec<SharedString> {
let mut seen = HashSet::new();
self.clone
.iter()
.map(|url| SharedString::from(format!("git clone {url}")))
.filter(|command| seen.insert(command.clone()))
.collect()
}
}
#[cfg(test)]