diff options
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/git/nostr_url.rs | 9 |
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 | ||
| 329 | fn replace_first_occurrence(s: &str, target: char, replacement: char) -> String { | 338 | fn replace_first_occurrence(s: &str, target: char, replacement: char) -> String { |