1 2 3 4 5 6 7 8 9 10 11 12 13 14
use core::str::FromStr; use super::Currency; use crate::{Error, Result}; impl FromStr for Currency { type Err = Error; fn from_str(s: &str) -> Result<Self> { Self::reverse_lookup(s).ok_or_else(|| Error::UnsupportedCurrency(s.to_owned())) } }