From 8f3212f269da12c031506067c51e279c2a64b8cc Mon Sep 17 00:00:00 2001 From: arkanoider Date: Mon, 23 Dec 2024 16:21:07 +0100 Subject: [PATCH 1/2] Fix: precision with native f64 value for total rating --- rust-toolchain.toml | 5 +++++ src/user.rs | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 rust-toolchain.toml diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..1173a45 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,5 @@ +[toolchain] +channel = "1.82.0" +profile = "minimal" +components = ["clippy", "rust-docs", "rustfmt"] +targets = ["wasm32-unknown-unknown"] \ No newline at end of file diff --git a/src/user.rs b/src/user.rs index 3830ac6..1e50f13 100644 --- a/src/user.rs +++ b/src/user.rs @@ -5,7 +5,7 @@ use sqlx::FromRow; /// Database representation of an user #[cfg_attr(feature = "sqlx", derive(FromRow))] -#[derive(Debug, Default, Deserialize, Serialize, Clone, PartialEq, Eq)] +#[derive(Debug, Default, Deserialize, Serialize, Clone, PartialEq)] pub struct User { pub pubkey: String, pub is_admin: i64, @@ -16,7 +16,7 @@ pub struct User { /// the trade_index is greater than the one we have in database pub last_trade_index: i64, pub total_reviews: i64, - pub total_rating: i64, + pub total_rating: f64, pub last_rating: i64, pub max_rating: i64, pub min_rating: i64, @@ -40,7 +40,7 @@ impl User { category, last_trade_index: trade_index, total_reviews: 0, - total_rating: 0, + total_rating: 0.0, last_rating: 0, max_rating: 0, min_rating: 0, From 8d856b61314b7be0fe6d2231dd3768a6cbf274a0 Mon Sep 17 00:00:00 2001 From: arkanoider Date: Mon, 23 Dec 2024 19:23:13 +0100 Subject: [PATCH 2/2] bump version to 0.6.19 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index b6ebc01..0b72c95 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mostro-core" -version = "0.6.18" +version = "0.6.19" edition = "2021" license = "MIT" authors = ["Francisco Calderón "]