1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
use core::ops::Mul;
use super::Money;
impl Mul for Money
{
type Output = Self;
/// # Panics
///
/// * If this currency and the `operand`'s currency are not the same.
/// * When [`Decimal::mul`] does.
///
/// # See also
///
/// * [`Mul::mul`]
///
/// # Examples
///
/// ```rust
/// # use pretty_assertions::assert_eq;
/// use money2::{Currency, Money};
///
/// assert_eq!(
/// Money::new(10, 0, Currency::Eur) * Money::new(2, 0, Currency::Eur),
/// Money::new(20, 0, Currency::Eur)
/// );
/// ```
///
/// ```rust,should_panic
/// # use pretty_assertions::assert_eq;
/// # use money2::{Currency, Money};
/// let _ = Money::new(10, 0, Currency::Eur) * Money::new(2, 0, Currency::Usd);
/// ```
fn mul(self, rhs: Self) -> Self::Output
{
self.unchecked(Mul::mul, rhs)
}
}