Replace borrowed strings (&str) with owned Strings, and remove the MessageEntry wrapper in favour of fluent_syntax::ast::Message. These may be re-visited in the future but for now are mostly unnecessary complexity that is blocking a file-oriented API, which is how the library will actually be used.
HJMYJDC77NLU44QZWIW7CELXJKD4EK4YZ6CCILYBG6FWGZ2KMBVAC XGNME3WRU3MJDTFHUFJYARLVXWBZIH5ODBOIIFTXHNCBTZQH2R7QC 5TEX4MNUC4LDDRMNEOVCFNUUEZAGUXMKO3OIEQFXWRQKXSHY2NRQC D652S2N3MHR7NJWSJIT7DUH5TPEFF6YII7EGV4C7IYWARXLMGAWQC O77KA6C4UJGZXVGPEA7WCRQH6XYQJPWETSPDXI3VOKOSRQND7JEQC NFHPBRB5AUJGWAN7UMUDUNFDGDOCKVUKC3AAPDTND7C7MJYISVVQC K4XW4OBW5VWRCQZJNVV624E25SKRJPZ5WUXWVYHP6U7T7NPJFMFQC pub(crate) fn message(message: &Message<String>) -> syn::Expr {if let Some(value) = message.value.as_ref() {pattern(value)} else {parse_quote!(())}}
pub enum GroupEntry<'resource> {Message(&'resource Message<&'resource str>),}#[derive(Debug)]pub struct Group<'resource> {pub children: Vec<GroupEntry<'resource>>,}impl<'resource> GroupEntry<'resource> {pub fn to_syn(&self) -> syn::Expr {match self {Self::Message(message) => message.value.as_ref().map_or_else(|| parse_quote!(()), crate::parse_fluent::pattern),}}pub fn id(&self) -> &'resource str {match self {Self::Message(message) => message.id.name,}}
pub struct Group {pub children: Vec<Message<String>>,
impl<'resource> TryFrom<&'resource Entry<&'resource str>> for GroupEntry<'resource> {type Error = ();fn try_from(value: &'resource Entry<&'resource str>) -> Result<Self, Self::Error> {match value {Entry::Message(message) => Ok(Self::Message(message)),_ => Err(()),}}}
impl Group {pub fn from_resource(resource: Resource<String>) -> Self {let mut children = Vec::new();
impl<'resource> Group<'resource> {pub fn from_resource(resource: &'resource Resource<&'resource str>) -> Self {let mut children = Vec::new();
for entry in resource.body {let matched_entry = if let Entry::Message(message) = entry {message} else {todo!()};