varunsrin / rusty_money

Money library for Rust
MIT License
85 stars 32 forks source link

Make Money implement Copy #60

Closed robinkrahl closed 1 year ago

robinkrahl commented 3 years ago

Money has two fields, a rust_decimal::Decimal instance and a reference. Both implement Copy, so Money should be able to derive Copy. The Copy documentation recommends that ‘[g]enerally speaking, if your type can implement Copy, it should.’ What do you think about making Money implement Copy? This would make calculations much less awkward.

brokenthorn commented 1 year ago

Yes, this would fix having to .clone() money instances in cases where you need to calculate various values based off of a common value.

FirelightFlagboy commented 1 year ago

This issue was fixed by #82