浏览代码

chore: clippy warnings (#1606)

tsk 1 周之前
父节点
当前提交
0e02b7c0ff
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      crates/cdk-ldk-node/src/web/handlers/utils.rs
  2. 1 1
      crates/cdk-signatory/src/common.rs

+ 1 - 1
crates/cdk-ldk-node/src/web/handlers/utils.rs

@@ -75,7 +75,7 @@ pub fn get_paginated_payments_streaming(
         .collect();
 
     // Sort by timestamp (newest first)
-    time_indexed.sort_unstable_by(|a, b| b.0.cmp(&a.0));
+    time_indexed.sort_unstable_by_key(|b| std::cmp::Reverse(b.0));
 
     let total_count = time_indexed.len();
 

+ 1 - 1
crates/cdk-signatory/src/common.rs

@@ -29,7 +29,7 @@ pub async fn init_keysets(
         // We only care about units that are supported
         if let Some((input_fee_ppk, max_order)) = supported_units.get(&unit) {
             let mut keysets = keysets;
-            keysets.sort_by(|a, b| b.derivation_path_index.cmp(&a.derivation_path_index));
+            keysets.sort_by_key(|b| std::cmp::Reverse(b.derivation_path_index));
 
             if let Some(highest_index_keyset) = keysets.first() {
                 // Check if it matches our criteria