add method to filter useless repos
This commit is contained in:
parent
55a1c57212
commit
6704f79939
|
@ -33,5 +33,8 @@ pub async fn get_org_repos(org: String) -> Vec<Repo> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn filter_repos(repos: Vec<Repo>) -> 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()
|
||||||
}
|
}
|
Loading…
Reference in New Issue