I tried to make the Event API/interface more ergonomic.
Similiar to another refactoring which I did in the past (https://gitlab.com/tglman/persy/merge_requests/8), I changed the EventListener such that it contains a reference to the associated Event, and wrapped this reference inside an Arc<Mutex<>> to make it thread-safe. Listeners now de-register themselves in the destructor (Drop trait).
Additionally, I tried to get rid of some clippy warnings.
And then I noticed that the global argument in Widget::update calls isn't used anymore and could be dropped.
P.S.: I think that the event part of widget.rs should be split into a separate file, because it is independent of the Widget trait.
I tried to make the Event API/interface more ergonomic.
Similiar to another refactoring which I did in the past (https://gitlab.com/tglman/persy/merge_requests/8), I changed the EventListener such that it contains a reference to the associated Event, and wrapped this reference inside an
Arc<Mutex<>>
to make it thread-safe. Listeners now de-register themselves in the destructor (Drop trait
).Additionally, I tried to get rid of some clippy warnings.
And then I noticed that the
global
argument inWidget::update
calls isn't used anymore and could be dropped.P.S.: I think that the event part of
widget.rs
should be split into a separate file, because it is independent of theWidget
trait.