mirror of
https://github.com/lov3b/ecb-rates.git
synced 2025-02-23 02:10:07 +01:00
clarification
This commit is contained in:
parent
51d59eefe4
commit
b34cc4c1b6
@ -22,6 +22,10 @@ fn filter_currencies(exchange_rate_results: &mut [ExchangeRateResult], currencie
|
|||||||
.keys()
|
.keys()
|
||||||
.filter(|x| !currencies.contains(x))
|
.filter(|x| !currencies.contains(x))
|
||||||
.for_each(|key_to_remove| {
|
.for_each(|key_to_remove| {
|
||||||
|
/* This is safe, since we:
|
||||||
|
* 1. Already have a mutable reference.
|
||||||
|
* 2. Don't run the code in paralell
|
||||||
|
*/
|
||||||
let rates = unsafe { (*rates_ptr).borrow_mut() };
|
let rates = unsafe { (*rates_ptr).borrow_mut() };
|
||||||
rates.remove_entry(key_to_remove);
|
rates.remove_entry(key_to_remove);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user