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.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/git/nostr_url.rs b/src/lib/git/nostr_url.rs
index ce3e973..d1fee2e 100644
--- a/src/lib/git/nostr_url.rs
+++ b/src/lib/git/nostr_url.rs
@@ -21,8 +21,10 @@ pub struct NostrUrlDecoded {
21 21
22static INCORRECT_NOSTR_URL_FORMAT_ERROR: &str = "incorrect nostr git url format. try nostr://naddr123 or nostr://npub123/my-repo or nostr://ssh/npub123/relay.damus.io/my-repo"; 22static INCORRECT_NOSTR_URL_FORMAT_ERROR: &str = "incorrect nostr git url format. try nostr://naddr123 or nostr://npub123/my-repo or nostr://ssh/npub123/relay.damus.io/my-repo";
23 23
24impl NostrUrlDecoded { 24impl std::str::FromStr for NostrUrlDecoded {
25 pub fn from_str(url: &str) -> Result<Self> { 25 type Err = anyhow::Error;
26
27 fn from_str(url: &str) -> Result<Self> {
26 let mut coordinates = HashSet::new(); 28 let mut coordinates = HashSet::new();
27 let mut protocol = None; 29 let mut protocol = None;
28 let mut user = None; 30 let mut user = None;
@@ -257,6 +259,8 @@ mod tests {
257 } 259 }
258 260
259 mod nostr_git_url_paramemters_from_str { 261 mod nostr_git_url_paramemters_from_str {
262 use std::str::FromStr;
263
260 use super::*; 264 use super::*;
261 265
262 fn get_model_coordinate(relays: bool) -> Coordinate { 266 fn get_model_coordinate(relays: bool) -> Coordinate {