From cc537251fe6d8dd62c90f79ebefb5a917091e0ad Mon Sep 17 00:00:00 2001 From: Paul Woolcock Date: Mon, 12 Feb 2018 15:32:00 -0500 Subject: [PATCH] Add 'Bitbucket' to RepoSite enum --- src/models/repo.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/models/repo.rs b/src/models/repo.rs index daef7cd..97c07f5 100644 --- a/src/models/repo.rs +++ b/src/models/repo.rs @@ -29,13 +29,15 @@ impl RepoPath { pub enum RepoSite { Github, Gitlab, + Bitbucket, } impl RepoSite { pub fn to_base_uri(&self) -> &'static str { match self { &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 { "github" => Ok(RepoSite::Github), "gitlab" => Ok(RepoSite::Gitlab), + "bitbucket" => Ok(RepoSite::Bitbucket), _ => Err(format_err!("unknown repo site identifier")) } } @@ -56,7 +59,8 @@ impl AsRef for RepoSite { fn as_ref(&self) -> &str { match self { &RepoSite::Github => "github", - &RepoSite::Gitlab => "gitlab" + &RepoSite::Gitlab => "gitlab", + &RepoSite::Bitbucket => "https://bitbucket.org", } } }