fn parse(s: &str) -> RepoConfig {
        let parts: Vec<&str> = s.split(',').collect();
        match parts.as_slice() {
            [lookup_key, url] => RepoConfig {
                lookup_key: String::from(*lookup_key),
                url: String::from(*url),
                deploy_key_path: None,
            },
            [lookup_key, url, deploy_key_path] => RepoConfig {
                lookup_key: String::from(*lookup_key),
                url: String::from(*url),
                deploy_key_path: Some(std::path::PathBuf::from(deploy_key_path)),
            },
            _ => panic!("no"),
        }
    }
/// parse a repo string of the form URL,key-path or just URL
/// into a repo
parse a repo string of the form URL,key-path or just URL
into a repo
parse a repo string of the form URL key - path or just URL into a repo
fn parse(s: &str) -> RepoConfig {
        let parts: Vec<&str> = s.split(',').collect();
        match parts.as_slice() {
            [lookup_key, url] => RepoConfig {
                lookup_key: String::from(*lookup_key),
                url: String::from(*url),
                deploy_key_path: None,
            },
            [lookup_key, url, deploy_key_path] => RepoConfig {
                lookup_key: String::from(*lookup_key),
                url: String::from(*url),
                deploy_key_path: Some(std::path::PathBuf::from(deploy_key_path)),
            },
            _ => panic!("no"),
        }
    }
fn parse ( s : & str ) -> RepoConfig { let parts : Vec < & str > = s . split ( ',' ) . collect ( ) ; match parts . as_slice ( ) { [ lookup_key , url ] => RepoConfig { lookup_key : String :: from ( * lookup_key ) , url : String :: from ( * url ) , deploy_key_path : None , } , [ lookup_key , url , deploy_key_path ] => RepoConfig { lookup_key : String :: from ( * lookup_key ) , url : String :: from ( * url ) , deploy_key_path : Some ( std :: path :: PathBuf :: from ( deploy_key_path ) ) , } , _ => panic ! ( " " ) , } }
parse a repo string of the form URL,key-path or just URL
into a repo
parse a repo string of the form URL key - path or just URL into a repo
s
&str
s
&str