Fixed a few things
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "osui-element"
|
name = "osui-element"
|
||||||
version = "0.1.22"
|
version = "0.1.23"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "The element attribute for defining elements in OSUI"
|
description = "The element attribute for defining elements in OSUI"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ pub fn element(_args: TokenStream, input: TokenStream) -> TokenStream {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[proc_macro_attribute]
|
#[proc_macro_attribute]
|
||||||
pub fn component(_args: TokenStream, input: TokenStream) -> TokenStream {
|
pub fn component(_: TokenStream, input: TokenStream) -> TokenStream {
|
||||||
let input_fn = parse_macro_input!(input as ItemFn);
|
let input_fn = parse_macro_input!(input as ItemFn);
|
||||||
|
|
||||||
let fn_name = input_fn.sig.ident.clone();
|
let fn_name = input_fn.sig.ident.clone();
|
||||||
@@ -135,7 +135,8 @@ pub fn component(_args: TokenStream, input: TokenStream) -> TokenStream {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl <#(#lifetimes),*> Component for #fn_name <#(#lifetimes),*> {
|
impl <#(#lifetimes),*> Component for #fn_name <#(#lifetimes),*> {
|
||||||
fn create_element(self) -> #return_type {
|
type Element = #return_type;
|
||||||
|
fn create_element(self) -> Self::Element {
|
||||||
#code
|
#code
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user