浏览代码

Merge pull request #1624 from apiraino/remove-redundant-rfcbot-queries

Remove redundant queries to rfcbot.rs
Santiago Pastorino 2 年之前
父节点
当前提交
8252d6335c
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      src/github.rs

+ 6 - 1
src/github.rs

@@ -6,6 +6,7 @@ use hyper::header::HeaderValue;
 use once_cell::sync::OnceCell;
 use reqwest::header::{AUTHORIZATION, USER_AGENT};
 use reqwest::{Client, Request, RequestBuilder, Response, StatusCode};
+use std::collections::HashMap;
 use std::convert::TryInto;
 use std::{
     fmt,
@@ -1120,7 +1121,11 @@ impl<'q> IssuesQuery for Query<'q> {
             .await
             .with_context(|| "Unable to get issues.")?;
 
-        let fcp_map = crate::rfcbot::get_all_fcps().await?;
+        let fcp_map = if include_fcp_details {
+            crate::rfcbot::get_all_fcps().await?
+        } else {
+            HashMap::new()
+        };
 
         let mut issues_decorator = Vec::new();
         for issue in issues {