please rust analyzer with macros
This commit is contained in:
@@ -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())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user