mirror of
https://git.proxmox.com/git/perlmod
synced 2025-10-05 04:10:00 +00:00
macro: upgrade boot attribute to a full path
This is a lot more flexible than just a single ident. Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
e2d4ad4e96
commit
82b4d14ad3
@ -8,7 +8,7 @@ pub struct ModuleAttrs {
|
|||||||
pub file_name: Option<String>,
|
pub file_name: Option<String>,
|
||||||
pub lib_name: Option<String>,
|
pub lib_name: Option<String>,
|
||||||
pub write: Option<bool>,
|
pub write: Option<bool>,
|
||||||
pub boot: Option<Ident>,
|
pub boot: Option<syn::Path>,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn is_ident_check_dup<T>(path: &syn::Path, var: &Option<T>, what: &'static str) -> bool {
|
fn is_ident_check_dup<T>(path: &syn::Path, var: &Option<T>, what: &'static str) -> bool {
|
||||||
@ -46,7 +46,7 @@ impl TryFrom<AttributeArgs> for ModuleAttrs {
|
|||||||
} else if is_ident_check_dup(&path, &lib_name, "lib") {
|
} else if is_ident_check_dup(&path, &lib_name, "lib") {
|
||||||
lib_name = Some(expand_env_vars(&litstr)?);
|
lib_name = Some(expand_env_vars(&litstr)?);
|
||||||
} else if is_ident_check_dup(&path, &boot, "boot") {
|
} else if is_ident_check_dup(&path, &boot, "boot") {
|
||||||
boot = Some(litstr.parse::<Ident>()?);
|
boot = Some(litstr.parse::<syn::Path>()?);
|
||||||
} else {
|
} else {
|
||||||
error!(path => "unknown argument");
|
error!(path => "unknown argument");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user