add method to filter useless repos

This commit is contained in:
b1ek 2023-08-05 02:19:47 +10:00
parent 55a1c57212
commit 6704f79939
Signed by: blek
GPG Key ID: 14546221E3595D0C
1 changed files with 4 additions and 1 deletions

View File

@ -33,5 +33,8 @@ pub async fn get_org_repos(org: String) -> Vec<Repo> {
}
pub fn filter_repos(repos: Vec<Repo>) -> Vec<Repo> {
repos.iter().filter_map(|x| { if (!x.archived) && x.has_pull_requests { Some(x) } else { None } }).collect::<Vec<Repo>>()
repos.iter()
.filter(|x| (!x.archived) && x.has_pull_requests)
.cloned()
.collect()
}