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