(&self, path: &str)
| 166 | } |
| 167 | |
| 168 | fn github_get<T: DeserializeOwned>(&self, path: &str) -> Result<T> { |
| 169 | let url = format!("https://api.github.com{path}"); |
| 170 | let response = self.http.get(&url).send()?; |
| 171 | if !response.status().is_success() { |
| 172 | bail!("GET {url} failed with HTTP {}", response.status()); |
| 173 | } |
| 174 | Ok(response.json()?) |
| 175 | } |
| 176 | |
| 177 | fn pull_request(&self, repo: &Repo, pr_number: u64) -> Result<PullRequest> { |
| 178 | self.github_get(&format!("/repos/{}/{}/pulls/{pr_number}", repo.owner, repo.name)) |