Skip to content

Commit e9f8f0a

Browse files
Clean diff
1 parent fcf6047 commit e9f8f0a

File tree

2 files changed

+3
-24
lines changed

2 files changed

+3
-24
lines changed

src/types/models/download_count.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -38,24 +38,3 @@ impl Serialize for DownloadCount {
3838
}
3939
}
4040
}
41-
42-
#[cfg(test)]
43-
mod tests {
44-
use super::DownloadCount;
45-
46-
#[test]
47-
fn serializes_as_number_by_default() {
48-
let serialized = serde_json::to_string(&DownloadCount::new(1234)).unwrap();
49-
50-
assert_eq!(serialized, "1234");
51-
}
52-
53-
#[test]
54-
fn serializes_as_abbreviated_string_when_enabled() {
55-
let mut count = DownloadCount::new(1234);
56-
count.set_abbreviated(true);
57-
let serialized = serde_json::to_string(&count).unwrap();
58-
59-
assert_eq!(serialized, "\"1.2K\"");
60-
}
61-
}

src/types/models/mod_entity.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ use crate::{
2323
},
2424
};
2525
use semver::Version;
26+
use serde::Serialize;
27+
use utoipa::ToSchema;
2628
use sqlx::{
2729
PgConnection,
2830
types::chrono::{DateTime, Utc},
2931
};
3032
use std::collections::HashMap;
31-
use serde::Serialize;
32-
use utoipa::ToSchema;
3333

34-
#[derive(Serialize, Debug, Clone, ToSchema)]
34+
#[derive(Serialize, Debug, Clone, sqlx::FromRow, ToSchema)]
3535
pub struct Mod {
3636
pub id: String,
3737
pub repository: Option<String>,

0 commit comments

Comments
 (0)