Skip to content

Commit 34314e4

Browse files
committed
fixed imports and if else simplification
1 parent e3881ab commit 34314e4

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

fplus-lib/src/core/mod.rs

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use octocrab::models::{
66
pulls::PullRequest,
77
repos::{Content, ContentItems},
88
};
9+
use rayon::prelude::*;
910
use reqwest::Response;
1011
use serde::{Deserialize, Serialize};
1112
use chrono::{DateTime, Utc};
@@ -20,7 +21,7 @@ use crate::{
2021
},
2122
parsers::ParsedIssue,
2223
};
23-
use fplus_database::database;
24+
use fplus_database::database::{self, allocators::get_allocator};
2425
use fplus_database::models::applications::Model as ApplicationModel;
2526

2627
use self::application::file::{
@@ -253,24 +254,20 @@ impl LDNApplication {
253254
pull_requests
254255
.into_iter()
255256
.map(|pr: PullRequest| {
256-
(LDNApplication::load_pr_files(pr, owner.clone(), repo.clone()))
257+
LDNApplication::load_pr_files(pr, owner.clone(), repo.clone())
257258
})
258259
.collect::<Vec<_>>(),
259260
)
260261
.await?;
261262
let result = pull_requests
262-
.par_iter()
263-
.filter(|pr| {
264-
if let Some(r) = pr {
265-
if String::from(r.2.id.clone()) == application_id.clone() {
266-
return true;
267-
} else {
268-
return false;
269-
}
270-
} else {
271-
return false;
272-
}
273-
})
263+
.par_iter()
264+
.filter(|pr| {
265+
if let Some(r) = pr {
266+
String::from(r.2.id.clone()) == application_id.clone()
267+
} else {
268+
false
269+
}
270+
})
274271
.collect::<Vec<_>>();
275272
if let Some(r) = result.get(0) {
276273
if let Some(r) = r {

0 commit comments

Comments
 (0)