Small helper to get the path of the fluent resource. In the future this will need to be a more complex type than PathBuf
to handle multiple locales and data sources.
QSK7JRBA55ZRY322WXGNRROJL7NTFBR6MJPOOA5B2XD2JAVM4MWQC
}
}
}
pub fn attribute_path(attribute: syn::Attribute) -> PathBuf {
match attribute.meta {
syn::Meta::List(list_data) => {
let path_literal: syn::LitStr = syn::parse2(list_data.tokens).unwrap();
let supplied_path = PathBuf::from(path_literal.value());
// TODO: path should be relative to source file, not working directory
supplied_path.canonicalize().unwrap()