diff options
Diffstat (limited to 'src/model/state.rs')
-rw-r--r-- | src/model/state.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/model/state.rs b/src/model/state.rs index 608bc9f..1e32bfa 100644 --- a/src/model/state.rs +++ b/src/model/state.rs @@ -53,18 +53,20 @@ impl RepoState { Ok(RepoState { name, repo }) } - pub fn stat(&self) -> Result<cached::Return<RepositoryStat>> { + pub async fn stat(&self) -> Result<cached::Return<RepositoryStat>> { + let (branches, tags) = futures::try_join!(self.branch_names(), self.tag_names())?; + Ok(cached::Return::new(RepositoryStat { - branches: self.branch_names()?.value, - tags: self.tag_names()?.value, + branches: branches.value, + tags: tags.value, })) } - pub fn branch_names(&self) -> Result<cached::Return<Vec<String>>> { + pub async fn branch_names(&self) -> Result<cached::Return<Vec<String>>> { get_branch_names(&self.name, &self.repo) } - pub fn tag_names(&self) -> Result<cached::Return<Vec<String>>> { + pub async fn tag_names(&self) -> Result<cached::Return<Vec<String>>> { get_tag_names(&self.name, &self.repo) } } |