Skip to content

Commit

Permalink
fix: remove par iter 3:
Browse files Browse the repository at this point in the history
  • Loading branch information
awwpotato committed Oct 15, 2024
1 parent 074fcc4 commit 8f3d3f0
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 81 deletions.
100 changes: 24 additions & 76 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ tower-http = { version = "0.6.1", features = ["fs", "trace"] }
tba-openapi-rust = { git = "https://github.com/awwpotato/tba-openapi-rust" }
chrono = "0.4.38"
rand = "0.8.5"
rayon = "1.10.0"
7 changes: 3 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
use chrono::{Datelike, Local, TimeZone};
use model::PulseData;
use rand::{seq::SliceRandom, thread_rng};
use rayon::prelude::*;
use tba_openapi_rust::{
apis::{configuration::Configuration, event_api},
models::event_ranking_rankings_inner::EventRankingRankingsInner,
Expand Down Expand Up @@ -93,7 +92,7 @@ pub async fn get_pulse_data(

let myUpcommingMatches: Vec<NexusMatch> = data
.matches
.into_par_iter()
.into_iter()
.filter(|m| {
(m.redTeams.as_ref().unwrap().contains(&team_key.to_string())
|| m.blueTeams
Expand Down Expand Up @@ -150,12 +149,12 @@ pub async fn get_pulse_data(
matchInfo,
partsRequests: data
.partsRequests
.par_iter()
.iter()
.map(|pr| format!("Part request for team {}: {}", pr.requestedByTeam, pr.parts))
.collect(),
announcements: data
.announcements
.par_iter()
.iter()
.map(|a| format!("Event announcement: {}", a.announcement))
.collect(),
myUpcommingMatches,
Expand Down

0 comments on commit 8f3d3f0

Please sign in to comment.