mirror of
https://github.com/deps-rs/deps.rs.git
synced 2024-11-22 10:26:30 +00:00
Add 'Bitbucket' to RepoSite enum
This commit is contained in:
parent
b828de404e
commit
cc537251fe
1 changed files with 6 additions and 2 deletions
|
@ -29,13 +29,15 @@ impl RepoPath {
|
||||||
pub enum RepoSite {
|
pub enum RepoSite {
|
||||||
Github,
|
Github,
|
||||||
Gitlab,
|
Gitlab,
|
||||||
|
Bitbucket,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RepoSite {
|
impl RepoSite {
|
||||||
pub fn to_base_uri(&self) -> &'static str {
|
pub fn to_base_uri(&self) -> &'static str {
|
||||||
match self {
|
match self {
|
||||||
&RepoSite::Github => "https://github.com",
|
&RepoSite::Github => "https://github.com",
|
||||||
&RepoSite::Gitlab => "https://gitlab.com"
|
&RepoSite::Gitlab => "https://gitlab.com",
|
||||||
|
&RepoSite::Bitbucket => "https://bitbucket.org",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -47,6 +49,7 @@ impl FromStr for RepoSite {
|
||||||
match input {
|
match input {
|
||||||
"github" => Ok(RepoSite::Github),
|
"github" => Ok(RepoSite::Github),
|
||||||
"gitlab" => Ok(RepoSite::Gitlab),
|
"gitlab" => Ok(RepoSite::Gitlab),
|
||||||
|
"bitbucket" => Ok(RepoSite::Bitbucket),
|
||||||
_ => Err(format_err!("unknown repo site identifier"))
|
_ => Err(format_err!("unknown repo site identifier"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -56,7 +59,8 @@ impl AsRef<str> for RepoSite {
|
||||||
fn as_ref(&self) -> &str {
|
fn as_ref(&self) -> &str {
|
||||||
match self {
|
match self {
|
||||||
&RepoSite::Github => "github",
|
&RepoSite::Github => "github",
|
||||||
&RepoSite::Gitlab => "gitlab"
|
&RepoSite::Gitlab => "gitlab",
|
||||||
|
&RepoSite::Bitbucket => "https://bitbucket.org",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue