Skip to content

Commit

Permalink
Merge pull request #74 from MostroP2P/fix-rate-precision
Browse files Browse the repository at this point in the history
Fix: precision with native f64 value for total rating
  • Loading branch information
grunch authored Dec 23, 2024
2 parents fe2c9c3 + 8d856b6 commit f946919
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mostro-core"
version = "0.6.18"
version = "0.6.19"
edition = "2021"
license = "MIT"
authors = ["Francisco Calderón <[email protected]>"]
Expand Down
5 changes: 5 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[toolchain]
channel = "1.82.0"
profile = "minimal"
components = ["clippy", "rust-docs", "rustfmt"]
targets = ["wasm32-unknown-unknown"]
6 changes: 3 additions & 3 deletions src/user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit f946919

Please sign in to comment.