Skip to content

Commit fcf6047

Browse files
Clean diff
1 parent eb95673 commit fcf6047

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

src/abbreviate.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
const ONE_THOUSAND: f64 = 1_000.0;
22
const ONE_MILLION: f64 = 1_000_000.0;
3-
const ONE_MORBILLION: f64 = 1_000_000_000.0;
3+
const ONE_BILLION: f64 = 1_000_000_000.0;
44

55
pub fn abbreviate_number(n: i32) -> String {
66
let n = n as f64;
7-
if n.abs() >= ONE_MORBILLION {
8-
format!("{:.1}B", n / ONE_MORBILLION)
7+
if n.abs() >= ONE_BILLION {
8+
format!("{:.1}B", n / ONE_BILLION)
99
} else if n.abs() >= ONE_MILLION {
1010
format!("{:.1}M", n / ONE_MILLION)
1111
} else if n.abs() >= ONE_THOUSAND {

src/endpoints/mods.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ use crate::types::models::mod_version_status::ModVersionStatusEnum;
2626
use crate::webhook::discord::DiscordWebhook;
2727
use actix_web::{HttpResponse, Responder, get, post, put, web};
2828
use serde::Deserialize;
29-
use sqlx::Acquire;
30-
use utoipa::{IntoParams, ToSchema};
3129
use serde::Serialize;
30+
use sqlx::Acquire;
31+
use utoipa::{ToSchema, IntoParams};
3232

3333
#[derive(Deserialize, Default, Hash, Eq, PartialEq, ToSchema)]
3434
#[serde(rename_all = "snake_case")]
@@ -78,6 +78,7 @@ pub struct CreateQueryParams {
7878
(status = 403, description = "Forbidden")
7979
)
8080
)]
81+
8182
#[get("/v1/mods")]
8283
pub async fn index(
8384
data: web::Data<AppData>,
@@ -214,9 +215,7 @@ pub async fn create(
214215
let existing: Option<Mod> = mods::get_one(&json.id, false, &mut pool).await?;
215216

216217
if json.id.starts_with("geode.") && !dev.admin {
217-
return Err(ApiError::BadRequest(
218-
"Only index admins may use mod ids that start with 'geode.'".into(),
219-
));
218+
return Err(ApiError::BadRequest("Only index admins may use mod ids that start with 'geode.'".into()));
220219
}
221220

222221
if let Some(m) = &existing {

0 commit comments

Comments
 (0)