Преглед на файлове

clean up lints & print statements

chaz-kiker преди 3 години
родител
ревизия
b8f4990279
променени са 5 файла, в които са добавени 1 реда и са изтрити 908 реда
  1. 0 830
      SomeFile.txt
  2. 0 6
      src/actions.rs
  3. 1 69
      src/github.rs
  4. 0 1
      src/interactions.rs
  5. 0 2
      src/rfcbot.rs

Файловите разлики са ограничени, защото са твърде много
+ 0 - 830
SomeFile.txt


+ 0 - 6
src/actions.rs

@@ -119,11 +119,8 @@ impl<'a> Action for Step<'a> {
         for (name, issues) in &results {
             if name == &"proposed_fcp" {
                 let fcp_map = crate::rfcbot::get_all_fcps().await.unwrap();
-                println!("fcp_map: {:#?}", fcp_map);
                 let mut fcp_results = Vec::new();
                 for issue_decorator in issues.into_iter() {
-                    println!("issue_decorator: {:#?}", &issue_decorator);
-                    println!("issue_decorator.html_url: {:#?}", &issue_decorator.html_url);
                     let key = format!(
                         "rust-lang/{}:{}:{}",
                         issue_decorator.repo_name.clone(),
@@ -143,9 +140,6 @@ impl<'a> Action for Step<'a> {
             }
         }
 
-        println!("self.name: {}", self.name);
-        println!("context: {:#?}", context);
-
         TEMPLATES
             .render(&format!("{}.tt", self.name), &context)
             .unwrap()

+ 1 - 69
src/github.rs

@@ -7,9 +7,8 @@ use futures::{future::BoxFuture, FutureExt};
 use hyper::header::HeaderValue;
 use once_cell::sync::OnceCell;
 use reqwest::header::{AUTHORIZATION, USER_AGENT};
-use reqwest::{Client, Request, RequestBuilder, Response, StatusCode, Url};
+use reqwest::{Client, Request, RequestBuilder, Response, StatusCode};
 use std::{
-    collections::HashMap,
     fmt,
     time::{Duration, SystemTime},
 };
@@ -839,8 +838,6 @@ pub fn files_changed(diff: &str) -> Vec<&str> {
     files
 }
 
-impl IssuesEvent {}
-
 #[derive(Debug, serde::Deserialize)]
 pub struct IssueSearchResult {
     pub total_count: usize,
@@ -1086,63 +1083,6 @@ impl<'q> IssuesQuery for Query<'q> {
     }
 }
 
-// // impl<'q> FCPQuery for Query<'q>
-// // where
-// //     Query<'q>: IssuesQuery,
-// #[async_trait]
-// impl<'q> FCPQuery for IssuesQuery {
-//     async fn query_fcp<'a>(
-//         &'a self,
-//         repo: &'a Repository,
-//         client: &'a GithubClient,
-//     ) -> anyhow::Result<Vec<crate::rfcbot::FCPDecorator>> {
-//         let url = Url::parse(&"https://rfcbot.rs/api/all")?;
-//         let res = reqwest::get(url)
-//             .await?
-//             .json::<Vec<crate::rfcbot::FullFCP>>()
-//             .await?;
-
-//         let mut map: HashMap<String, crate::rfcbot::FullFCP> = HashMap::new();
-//         for full_fcp in res.into_iter() {
-//             map.insert(
-//                 format!(
-//                     "https://github.com/{}/{}",
-//                     full_fcp.issue.repository.clone(),
-//                     full_fcp.issue.number.clone()
-//                 ),
-//                 full_fcp,
-//             );
-//         }
-
-//         let decorators = self.query(&repo, &client).await?;
-
-//         let fcp_decorators: Vec<_> = decorators
-//             .iter()
-//             .filter_map(|issue_decorator| {
-//                 if let Some(full_fcp) = map.get(&issue_decorator.html_url) {
-//                     Some(crate::rfcbot::FCPDecorator {
-//                         number: issue_decorator.number.clone(),
-//                         title: issue_decorator.title.clone(),
-//                         html_url: issue_decorator.html_url.clone(),
-//                         repo_name: issue_decorator.repo_name.clone(),
-//                         labels: issue_decorator.labels.clone(),
-//                         assignees: issue_decorator.assignees.clone(),
-//                         updated_at: issue_decorator.updated_at.clone(),
-
-//                         bot_tracking_comment: full_fcp.fcp.fk_bot_tracking_comment.to_string(),
-//                         bot_tracking_comment_content: full_fcp.status_comment.body.clone(),
-//                         initiating_comment: full_fcp.fcp.fk_initiating_comment.to_string(),
-//                         initiating_comment_content: String::new(),
-//                     })
-//                 } else {
-//                     None
-//                 }
-//             })
-//             .collect();
-//         Ok(fcp_decorators)
-//     }
-// }
-
 #[derive(Debug, serde::Deserialize)]
 #[serde(rename_all = "snake_case")]
 pub enum CreateKind {
@@ -1435,14 +1375,6 @@ pub trait IssuesQuery {
         client: &'a GithubClient,
     ) -> anyhow::Result<Vec<crate::actions::IssueDecorator>>;
 }
-// #[async_trait]
-// pub trait FCPQuery {
-//     async fn query_fcp<'a>(
-//         &'a self,
-//         repo: &'a Repository,
-//         client: &'a GithubClient,
-//     ) -> anyhow::Result<Vec<crate::rfcbot::FCPDecorator>>;
-// }
 
 #[cfg(test)]
 mod tests {

+ 0 - 1
src/interactions.rs

@@ -1,6 +1,5 @@
 use crate::github::{GithubClient, Issue};
 use std::fmt::Write;
-use tracing as log;
 
 pub struct ErrorComment<'a> {
     issue: &'a Issue,

+ 0 - 2
src/rfcbot.rs

@@ -122,8 +122,6 @@ impl FCPDecorator {
 pub async fn get_all_fcps() -> anyhow::Result<HashMap<String, FullFCP>> {
     let url = Url::parse(&"https://rfcbot.rs/api/all")?;
     let res = reqwest::get(url).await?.json::<Vec<FullFCP>>().await?;
-    println!("res: {:#?}", res);
-
     let mut map: HashMap<String, FullFCP> = HashMap::new();
     for full_fcp in res.into_iter() {
         map.insert(

Някои файлове не бяха показани, защото твърде много файлове са промени