/// Tries to guess type of source control used for the repo URL.
/// It's a guess, and it won't be 100% accurate, because Cargo suggests using
/// user-friendly URLs or webpages instead of tool-specific URL schemes.
Tries to guess type of source control used for the repo URL.
It's a guess, and it won't be 100% accurate, because Cargo suggests using
user-friendly URLs or webpages instead of tool-specific URL schemes.
Tries to guess type of source control used for the repo URL . It ' s a guess and it won ' t be 100% accurate because Cargo suggests using user - friendly URLs or webpages instead of tool - specific URL schemes .
pub(crate) fn repository_type(&self) -> Option<&str> {
        if let Some(ref repo) = self.repository {
            if repo.starts_with("git+")
                || repo.ends_with(".git")
                || repo.contains("git@")
                || repo.contains("github.com")
                || repo.contains("gitlab.com")
            {
                return Some("Git");
            }
            if repo.starts_with("cvs+") || repo.contains("pserver:") || repo.contains("@cvs.") {
                return Some("Cvs");
            }
            if repo.starts_with("hg+") || repo.contains("hg@") || repo.contains("/hg.") {
                return Some("Hg");
            }
            if repo.starts_with("svn+") || repo.contains("/svn.") {
                return Some("Svn");
            }
            return None;
        }
        None
    }
pub ( crate ) fn repository_type ( & self ) -> Option < & str > { if let Some ( ref repo ) = self . repository { if repo . starts_with ( " " ) || repo . ends_with ( " " ) || repo . contains ( " " ) || repo . contains ( " " ) || repo . contains ( " " ) { return Some ( " " ) ; } if repo . starts_with ( " " ) || repo . contains ( " " ) || repo . contains ( " " ) { return Some ( " " ) ; } if repo . starts_with ( " " ) || repo . contains ( " " ) || repo . contains ( " " ) { return Some ( " " ) ; } if repo . starts_with ( " " ) || repo . contains ( " " ) { return Some ( " " ) ; } return None ; } None }
Tries to guess type of source control used for the repo URL.
Tries to guess type of source control used for the repo URL .
&self