add trait from<u128> to Num

This commit is contained in:
b1ek 2023-08-01 14:40:35 +10:00
parent f8c79609bb
commit 633649ad7e
Signed by: blek
GPG Key ID: 14546221E3595D0C
1 changed files with 6 additions and 0 deletions

View File

@ -22,4 +22,10 @@ impl std::ops::Mul<u128> for Num {
fn mul(self, rhs: u128) -> Self::Output { fn mul(self, rhs: u128) -> Self::Output {
self.number * rhs self.number * rhs
} }
}
impl From<u128> for Num {
fn from(number: u128) -> Self {
Num { number }
}
} }