Skip to content

Commit

Permalink
fix: 修正b50排序功能错误
Browse files Browse the repository at this point in the history
  • Loading branch information
龚亦航 committed Nov 14, 2023
1 parent 1e274e9 commit 2ca12e4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ path = "src/lib.rs"
[package]
authors = ["AnselYuki"]
name = "maimai-search"
version = "0.4.2"
version = "0.4.3"
edition = "2021"
repository = "https://github.com/Anselyuki/maimai-search-rs"

Expand Down
9 changes: 8 additions & 1 deletion src/clients/user_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ pub mod entity {
pub sd: Vec<ChartInfoResponse>,
}

#[derive(Serialize, Deserialize, PartialOrd)]
#[derive(Serialize, Deserialize)]
pub struct ChartInfoResponse {
/// 达成率
pub achievements: f32,
Expand Down Expand Up @@ -212,6 +212,12 @@ pub mod entity {
}
}

impl PartialOrd for ChartInfoResponse {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
Some(self.cmp(other))
}
}

impl Eq for ChartInfoResponse {}

impl Ord for ChartInfoResponse {
Expand All @@ -228,6 +234,7 @@ pub mod entity {
}
}


impl Display for ChartInfoResponse {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(
Expand Down

0 comments on commit 2ca12e4

Please sign in to comment.