Implement the collection traits on Exchange #6
Labels
No labels
kind
bug
kind
enhancement
kind
refactor
workflow
needs-info
workflow
needs-triage
workflow
ready-for-agent
workflow
ready-for-human
workflow
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
rosa/lucre#6
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Exchangeis a keyed collection of rates, but implements none of the traits Rustcollections are expected to carry.
MoneyBaginsrc/bag.rsalready establisheswhat this should look like in this crate;
Exchangehas none of it.Missing:
FromIterator<ExchangeRate>— a sequence of quotes cannot becollect()ed into a table.Extend<ExchangeRate>andExtend<&ExchangeRate>.IntoIteratorforExchangeand&Exchange.quotes()should beiter(). C-ITER asks that the method yielding acollection's elements be named
iter, andMoneyBag::iter(src/bag.rs:209)already follows it.
impl ExactSizeIterator. C-ITER-TY asks forone,
bag.rsnamesBalances/IntoBalances, and naming it is what makesroom for
DoubleEndedIteratorandFusedIterator— both supported by theunderlying
btree_map::Iterand both exposed byBalances(
src/bag.rs:383-395). Today a table cannot be walked in reverse.Guidelines: C-COLLECT, C-ITER, C-ITER-TY.