I think this might work if I can work out the lifetime notation, am I wrong?
pub fn from<T:Pattern>(from: T) -> Result<Tag, &'static str> { match from { 'A'|"A" => Ok(Tag::ChA), 'B'|"B" => Ok(Tag::ChB), 'C'|"C" => Ok(Tag::ChC), 'D'|"D" => Ok(Tag::ChD), 'T'|"Tmpr" => Ok(Tag::Tmpr), 'Y'|"Batt" => Ok(Tag::Batt), 'L'|"Acc" => Ok(Tag::Acc), _ => Err("Error: unknown channel"), } }