please rust analyzer with macros

This commit is contained in:
2025-08-16 02:34:44 -04:00
parent 166394d8d9
commit b0fe7310eb
5 changed files with 45 additions and 32 deletions

View File

@@ -33,7 +33,6 @@ pub struct Sensor<Ctx> {
pub type SensorMap<Ctx> = HashMap<Id, SensorGroup<Ctx>>;
pub type ActiveSensors = Vec<(SenseShape, Id)>;
pub trait SenseFn_<Ctx> = FnMut(&mut Ui<Ctx>, &mut Ctx) + 'static;
pub type SenseShape = UiRegion;
#[derive(Clone)]
pub struct SenseTrigger {
@@ -45,10 +44,10 @@ pub struct SensorGroup<Ctx> {
pub cursor: ActivationState,
pub sensors: Vec<Sensor<Ctx>>,
}
pub trait SenseFn<Ctx>: SenseFn_<Ctx> {
pub trait SenseFn<Ctx>: FnMut(&mut Ui<Ctx>, &mut Ctx) + 'static {
fn box_clone(&self) -> Box<dyn SenseFn<Ctx>>;
}
impl<F: SenseFn_<Ctx> + Clone, Ctx> SenseFn<Ctx> for F {
impl<F: FnMut(&mut Ui<Ctx>, &mut Ctx) + 'static + Clone, Ctx> SenseFn<Ctx> for F {
fn box_clone(&self) -> Box<dyn SenseFn<Ctx>> {
Box::new(self.clone())
}