Merge pull request #4 from twistedfall/money_constructors
Improve usability of predefined Money constructors
This commit is contained in:
commit
5ba6971b95
|
@ -77,7 +77,7 @@ pub struct Money {
|
||||||
macro_rules! impl_money {
|
macro_rules! impl_money {
|
||||||
($name:ident, $type:expr) => {
|
($name:ident, $type:expr) => {
|
||||||
#[doc=concat!("Creates a instance of Money with the currency ", stringify!($type))]
|
#[doc=concat!("Creates a instance of Money with the currency ", stringify!($type))]
|
||||||
pub fn $name(value: &str) -> Self {
|
pub fn $name(value: impl ToString) -> Self {
|
||||||
Self {
|
Self {
|
||||||
currency_code: $type,
|
currency_code: $type,
|
||||||
value: value.to_string(),
|
value: value.to_string(),
|
||||||
|
|
Loading…
Reference in a new issue