MCPcopy Create free account
hub / github.com/emwalker/digraph / from

Method from

backend/src/graphql/alert.rs:46–58  ·  view source on GitHub ↗
(alert: &types::Alert)

Source from the content-addressed store, hash-verified

44
45impl 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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected