input, proc: add full paths in macros

This commit is contained in:
🪞👃🪞 2025-05-09 22:43:12 +03:00
parent 20ccff13de
commit fe8ecf8a98
2 changed files with 8 additions and 6 deletions

View file

@ -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<E: Engine> Handle<E> for $Struct {
impl<E: Engine> ::tengri::input::Handle<E> for $Struct {
fn handle (&mut $self, $input: &E) -> Perhaps<E::Handled> {
$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
}
}