(name: &str, url_template: &str, reply_members: Vec<&str>)
| 34 | } |
| 35 | impl Source { |
| 36 | pub fn new(name: &str, url_template: &str, reply_members: Vec<&str>) -> Self { |
| 37 | Source { |
| 38 | name: name.to_owned(), |
| 39 | url_template: url_template.to_owned(), |
| 40 | reply_members: reply_members |
| 41 | .into_iter() |
| 42 | .map(std::borrow::ToOwned::to_owned) |
| 43 | .collect(), |
| 44 | } |
| 45 | } |
| 46 | pub fn url(&self, currency_lc: &str, currency: &str) -> String { |
| 47 | self.url_template |
| 48 | .replace("{currency_lc}", currency_lc) |