upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/git/nostr_url.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lib/git/nostr_url.rs b/src/lib/git/nostr_url.rs
index 2717916..d0e6d8a 100644
--- a/src/lib/git/nostr_url.rs
+++ b/src/lib/git/nostr_url.rs
@@ -324,6 +324,15 @@ impl CloneUrl {
324 pub fn protocol(&self) -> ServerProtocol { 324 pub fn protocol(&self) -> ServerProtocol {
325 self.protocol.clone() 325 self.protocol.clone()
326 } 326 }
327
328 pub fn short_name(&self) -> String {
329 let domain = self.domain();
330 if domain.is_empty() {
331 self.original_string.to_string()
332 } else {
333 domain
334 }
335 }
327} 336}
328 337
329fn replace_first_occurrence(s: &str, target: char, replacement: char) -> String { 338fn replace_first_occurrence(s: &str, target: char, replacement: char) -> String {