Skip to content

Commit c32b646

Browse files
committed
Use HashMap::values() method to access only values
1 parent ce0de1c commit c32b646

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/payment/store.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -686,14 +686,7 @@ where
686686
pub(crate) fn list_filter<F: FnMut(&&PaymentDetails) -> bool>(
687687
&self, f: F,
688688
) -> Vec<PaymentDetails> {
689-
self.payments
690-
.lock()
691-
.unwrap()
692-
.iter()
693-
.map(|(_, p)| p)
694-
.filter(f)
695-
.cloned()
696-
.collect::<Vec<PaymentDetails>>()
689+
self.payments.lock().unwrap().values().filter(f).cloned().collect::<Vec<PaymentDetails>>()
697690
}
698691

699692
fn persist_info(&self, id: &PaymentId, payment: &PaymentDetails) -> Result<(), Error> {

0 commit comments

Comments
 (0)