Add support for String
This commit is contained in:
9
simconnect-sdk-derive/src/helpers.rs
Normal file
9
simconnect-sdk-derive/src/helpers.rs
Normal file
@@ -0,0 +1,9 @@
|
||||
pub fn get_attribute(attrs: &[syn::Attribute]) -> Option<&syn::Attribute> {
|
||||
attrs
|
||||
.iter()
|
||||
.find(|&attr| attr.path.segments.len() == 1 && attr.path.segments[0].ident == "simconnect")
|
||||
}
|
||||
|
||||
pub fn mk_err<T: quote::ToTokens>(t: T, message: &str) -> proc_macro2::TokenStream {
|
||||
syn::Error::new_spanned(t, message).to_compile_error()
|
||||
}
|
Reference in New Issue
Block a user