From fe8ecf8a9822cafdd43e194fc25b681db09df62c Mon Sep 17 00:00:00 2001 From: unspeaker Date: Fri, 9 May 2025 22:43:12 +0300 Subject: [PATCH] input, proc: add full paths in macros --- input/src/input_handle.rs | 8 +++++--- proc/src/proc_command.rs | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/input/src/input_handle.rs b/input/src/input_handle.rs index 2a8fbcb..99bce29 100644 --- a/input/src/input_handle.rs +++ b/input/src/input_handle.rs @@ -18,15 +18,17 @@ pub trait Input: Send + Sync + Sized { /// Implement the [Handle] trait. #[macro_export] macro_rules! handle { (|$self:ident:$Struct:ty,$input:ident|$handler:expr) => { - impl Handle for $Struct { + impl ::tengri::input::Handle for $Struct { fn handle (&mut $self, $input: &E) -> Perhaps { $handler } } }; ($E:ty: |$self:ident:$Struct:ty,$input:ident|$handler:expr) => { - impl Handle<$E> for $Struct { - fn handle (&mut $self, $input: &$E) -> Perhaps<<$E as Input>::Handled> { + impl ::tengri::input::Handle<$E> for $Struct { + fn handle (&mut $self, $input: &$E) -> + Perhaps<<$E as ::tengri::input::Input>::Handled> + { $handler } } diff --git a/proc/src/proc_command.rs b/proc/src/proc_command.rs index 9504f91..cc5b134 100644 --- a/proc/src/proc_command.rs +++ b/proc/src/proc_command.rs @@ -68,7 +68,7 @@ impl ToTokens for CommandDef { } #block /// Generated by [tengri_proc]. - impl<'state> TryFromDsl<'state, #target> for #enumeration { + impl<'state> ::tengri::dsl::TryFromDsl<'state, #target> for #enumeration { fn try_from_expr <'source: 'state> ( state: &'state #target, iter: &mut ::tengri::dsl::TokenIter<'source> ) -> Option { @@ -88,7 +88,7 @@ impl ToTokens for CommandDef { } } /// Generated by [tengri_proc]. - impl Command<#target> for #enumeration { + impl ::tengri::input::Command<#target> for #enumeration { fn execute (self, state: &mut #target) -> Perhaps { match self { #(#implementations)* @@ -160,7 +160,7 @@ impl CommandArm { let give_err = LitStr::new(&format!("{}: missing value for \"{}\" ({})", quote!{#ident}, quote!{#arg}, quote!{#ty}), Span::call_site()); write_quote_to(&mut out, quote! { - #arg: Context::get(state, &mut iter).expect(#give_err), + #arg: ::tengri::dsl::Context::get(state, &mut iter).expect(#give_err), }); } out