diff --git a/reign_derive/src/framework/config.rs b/reign_derive/src/framework/config.rs index 161d608..3e9c514 100644 --- a/reign_derive/src/framework/config.rs +++ b/reign_derive/src/framework/config.rs @@ -8,16 +8,18 @@ pub fn config(input: DeriveInput) -> TokenStream { let scream = Ident::new(&to_screaming_snake_case(&ident.to_string()), ident.span()); quote! { - static #scream: ::reign::once_cell::sync::OnceCell<#ident> = ::reign::once_cell::sync::OnceCell::new(); + const _: () = { + static #scream: ::reign::once_cell::sync::OnceCell<#ident> = ::reign::once_cell::sync::OnceCell::new(); - impl ::reign::Config for #ident { - fn get() -> &'static Self { - #scream.get().expect("Config must be loaded before using it") - } + impl ::reign::Config for #ident { + fn get() -> &'static Self { + #scream.get().expect("Config must be loaded before using it") + } - fn cell() -> &'static ::reign::once_cell::sync::OnceCell { - &#scream + fn cell() -> &'static ::reign::once_cell::sync::OnceCell { + &#scream + } } - } + }; } } diff --git a/reign_derive/src/model/deleteable.rs b/reign_derive/src/model/deleteable.rs index dddbfbd..2302308 100644 --- a/reign_derive/src/model/deleteable.rs +++ b/reign_derive/src/model/deleteable.rs @@ -19,12 +19,12 @@ impl Model { } pub fn gen_tag_deleteable(&self, ident: &Ident, fields: &[ModelField]) -> TokenStream { - let gen_deleteable_methods = self.gen_deleteable_methods(ident, fields); - let gen_deleteable_actions = self.gen_deleteable_actions(ident, fields); + let gen_tag_deleteable_methods = self.gen_deleteable_methods(ident, fields); + let gen_tag_deleteable_actions = self.gen_deleteable_actions(ident, fields); quote! { - #gen_deleteable_methods - #gen_deleteable_actions + #gen_tag_deleteable_methods + #gen_tag_deleteable_actions } } diff --git a/src/cli/new/mod.rs b/src/cli/new/mod.rs index 3e33e0a..71cde31 100644 --- a/src/cli/new/mod.rs +++ b/src/cli/new/mod.rs @@ -13,7 +13,6 @@ pub struct New { impl New { pub fn run(&self) -> Result<(), Error> { - // TODO: cli: Allow option to merge let project = PathBuf::from(&self.name); Template::new(&project)