Update to rust 1.89 and edition 2024
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "automation_macro"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
edition = "2024"
|
||||
|
||||
[lib]
|
||||
proc-macro = true
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
#![feature(let_chains)]
|
||||
#![feature(iter_intersperse)]
|
||||
mod lua_device_config;
|
||||
|
||||
use lua_device_config::impl_lua_device_config_macro;
|
||||
use syn::{parse_macro_input, DeriveInput};
|
||||
use syn::{DeriveInput, parse_macro_input};
|
||||
|
||||
#[proc_macro_derive(LuaDeviceConfig, attributes(device_config))]
|
||||
pub fn lua_device_config_derive(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
|
||||
|
||||
@@ -6,8 +6,8 @@ use syn::punctuated::Punctuated;
|
||||
use syn::spanned::Spanned;
|
||||
use syn::token::Paren;
|
||||
use syn::{
|
||||
parenthesized, Data, DataStruct, DeriveInput, Expr, Field, Fields, FieldsNamed, LitStr, Result,
|
||||
Token, Type,
|
||||
Data, DataStruct, DeriveInput, Expr, Field, Fields, FieldsNamed, LitStr, Result, Token, Type,
|
||||
parenthesized,
|
||||
};
|
||||
|
||||
mod kw {
|
||||
@@ -155,7 +155,7 @@ fn field_from_lua(field: &Field) -> TokenStream {
|
||||
[] => field.ident.clone().unwrap().to_string(),
|
||||
[rename] => rename.to_owned(),
|
||||
_ => {
|
||||
return quote_spanned! {field.span() => compile_error!("Field contains duplicate 'rename'")}
|
||||
return quote_spanned! {field.span() => compile_error!("Field contains duplicate 'rename'")};
|
||||
}
|
||||
};
|
||||
|
||||
@@ -174,7 +174,7 @@ fn field_from_lua(field: &Field) -> TokenStream {
|
||||
[] => quote! {panic!(#missing)},
|
||||
[default] => default.to_owned(),
|
||||
_ => {
|
||||
return quote_spanned! {field.span() => compile_error!("Field contains duplicate 'default'")}
|
||||
return quote_spanned! {field.span() => compile_error!("Field contains duplicate 'default'")};
|
||||
}
|
||||
};
|
||||
|
||||
@@ -232,7 +232,7 @@ fn field_from_lua(field: &Field) -> TokenStream {
|
||||
[] => value,
|
||||
[value] => value.to_owned(),
|
||||
_ => {
|
||||
return quote_spanned! {field.span() => compile_error!("Only one of either 'from' or 'with' is allowed")}
|
||||
return quote_spanned! {field.span() => compile_error!("Only one of either 'from' or 'with' is allowed")};
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user