Listen to git commits for a specific repo and run a shell command

cargo fmt

vielle.dev a7bb68a5 29c04a75

verified
+15 -9
+15 -9
src/did.rs
··· 38 38 } 39 39 40 40 fn get_http_did(handle: &String) -> Result<String, ()> { 41 - let res = match reqwest::blocking::get("https://".to_owned() + handle + "/.well-known/atproto-did") { 42 - Ok(val) => val, 43 - Err(_) => return Err(()) 44 - }; 41 + let res = 42 + match reqwest::blocking::get("https://".to_owned() + handle + "/.well-known/atproto-did") { 43 + Ok(val) => val, 44 + Err(_) => return Err(()), 45 + }; 45 46 46 47 // as per spec, non 2xx code means failure 47 - if !res.status().is_success() { return Err(()) } 48 + if !res.status().is_success() { 49 + return Err(()); 50 + } 48 51 49 52 let did_unparsed = match res.text() { 50 - Ok(val) => val, 51 - Err(_) => return Err(()) 53 + Ok(val) => val, 54 + Err(_) => return Err(()), 52 55 }; 53 56 54 57 let did = did_unparsed.trim(); 55 58 56 - if !did.starts_with("did:") { return Err(()) }; 57 - return Ok(String::from(did)) 59 + if !did.starts_with("did:") { 60 + return Err(()); 61 + }; 62 + return Ok(String::from(did)); 63 + } 58 64 } 59 65 60 66 pub fn get_did(handle: String) -> Result<DidDoc, ()> {