* return all matching tx entries from retrieve_txs * rustfmt
This commit is contained in:
@@ -94,19 +94,12 @@ where
|
||||
{
|
||||
// just read the wallet here, no need for a write lock
|
||||
let mut txs = if let Some(id) = tx_id {
|
||||
let tx = wallet.tx_log_iter().find(|t| t.id == id);
|
||||
if let Some(t) = tx {
|
||||
vec![t]
|
||||
} else {
|
||||
vec![]
|
||||
}
|
||||
wallet.tx_log_iter().filter(|t| t.id == id).collect()
|
||||
} else if tx_slate_id.is_some() {
|
||||
let tx = wallet.tx_log_iter().find(|t| t.tx_slate_id == tx_slate_id);
|
||||
if let Some(t) = tx {
|
||||
vec![t]
|
||||
} else {
|
||||
vec![]
|
||||
}
|
||||
wallet
|
||||
.tx_log_iter()
|
||||
.filter(|t| t.tx_slate_id == tx_slate_id)
|
||||
.collect()
|
||||
} else {
|
||||
wallet.tx_log_iter().collect::<Vec<_>>()
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user