pub type OptionCode = u16; <% rows.each do |row| %> pub const <%= row.desc %>: OptionCode = <%= row.value %>; // <%= row.ref %>, ORO: <%= row.oro %>, SINGLETON: <%= row.single %> <% end %> pub fn to_str(a: OptionCode) -> Result<&'static str, ()> { match a { <% rows.each do |row| %> <%= row.value %> => Ok("<%= row.desc %>"), <% end %> _ => Err(()), } }