(alert: &types::Alert)
| 44 | |
| 45 | impl From<&types::Alert> for Alert { |
| 46 | fn from(alert: &types::Alert) -> Self { |
| 47 | let (alert_type, text) = match alert { |
| 48 | types::Alert::Danger(text) => (AlertType::Error, text), |
| 49 | types::Alert::Success(text) => (AlertType::Success, text), |
| 50 | types::Alert::Warning(text) => (AlertType::Warn, text), |
| 51 | }; |
| 52 | |
| 53 | Alert { |
| 54 | alert_type, |
| 55 | id: String::from("0"), |
| 56 | text: text.to_owned(), |
| 57 | } |
| 58 | } |
| 59 | } |
nothing calls this directly
no outgoing calls
no test coverage detected