varunsrin / rusty_money

Money library for Rust
MIT License
93 stars 34 forks source link

Why Currency as ref? #93

Open DavyJo opened 1 year ago

DavyJo commented 1 year ago

Hi, just wondering why the Currency is passed as a ref and not as owned? It makes getting started in fast manner pretty hard as pollution with lifetimes is hugely annoying in nested and complex data structures.

alopatindev commented 1 year ago

Taking into account that Currency and Money are currently Copy it seems there's no reason why they are still references.

Also Decimal is Copy but Money::amount returns reference too.

What's the reason for having so many references? Thanks.