Fix clippy errors + lint, use turbo CI

This commit is contained in:
Jai A
2024-10-18 16:07:35 -07:00
parent 663ab83b08
commit 8dd955563e
186 changed files with 10615 additions and 6433 deletions

View File

@@ -43,8 +43,9 @@ pub fn schedule_versions(
pool: sqlx::Pool<sqlx::Postgres>,
redis: RedisPool,
) {
let version_index_interval =
std::time::Duration::from_secs(parse_var("VERSION_INDEX_INTERVAL").unwrap_or(1800));
let version_index_interval = std::time::Duration::from_secs(
parse_var("VERSION_INDEX_INTERVAL").unwrap_or(1800),
);
scheduler.run(version_index_interval, move || {
let pool_ref = pool.clone();
@@ -71,7 +72,9 @@ pub enum VersionIndexingError {
}
use crate::{
database::{models::legacy_loader_fields::MinecraftGameVersion, redis::RedisPool},
database::{
models::legacy_loader_fields::MinecraftGameVersion, redis::RedisPool,
},
util::env::parse_var,
};
use chrono::{DateTime, Utc};
@@ -96,10 +99,12 @@ async fn update_versions(
pool: &sqlx::Pool<sqlx::Postgres>,
redis: &RedisPool,
) -> Result<(), VersionIndexingError> {
let input = reqwest::get("https://piston-meta.mojang.com/mc/game/version_manifest_v2.json")
.await?
.json::<InputFormat>()
.await?;
let input = reqwest::get(
"https://piston-meta.mojang.com/mc/game/version_manifest_v2.json",
)
.await?
.json::<InputFormat>()
.await?;
let mut skipped_versions_count = 0u32;
@@ -161,7 +166,8 @@ async fn update_versions(
.chars()
.all(|c| c.is_ascii_alphanumeric() || "-_.".contains(c))
{
if let Some((_, alternate)) = HALL_OF_SHAME.iter().find(|(version, _)| name == *version)
if let Some((_, alternate)) =
HALL_OF_SHAME.iter().find(|(version, _)| name == *version)
{
name = String::from(*alternate);
} else {