Say what these do without naming what calls them
A doc comment that describes another function goes stale when that function changes, and nobody editing it looks here.
This commit is contained in:
1 parent
36fec09d11
commit
23376aef25
2 files changed
+3
-5
No files matched your search
@@ -9,8 +9,7 @@ pub use rsc::*;
|
||||
pub trait Event: Sized + 'static + Clone {
|
||||
type Data<'a>: Clone = ();
|
||||
type State: Default = ();
|
||||
/// State the whole event type keeps, as opposed to `State`, which each
|
||||
/// widget keeps its own of.
|
||||
/// State the whole event type keeps, rather than one copy per widget.
|
||||
type Global: Default = ();
|
||||
#[allow(unused_variables)]
|
||||
fn should_run<'a>(&self, data: &Self::Data<'a>) -> Option<Self::Data<'a>> {
|
||||
@@ -18,8 +17,7 @@ pub trait Event: Sized + 'static + Clone {
|
||||
}
|
||||
|
||||
/// Whether having run on this data uses up whatever triggered it, so
|
||||
/// nothing further should see it. `run_event` reports back the `or` of
|
||||
/// this across everything that ran.
|
||||
/// nothing further should see it.
|
||||
#[allow(unused_variables)]
|
||||
fn consumes(&self, data: &Self::Data<'_>) -> bool {
|
||||
false
|
||||
|
||||
@@ -21,7 +21,7 @@ pub trait HasEvents: Sized + UiRsc + HasState {
|
||||
}
|
||||
|
||||
pub trait RunEvents: HasEvents {
|
||||
/// Whether anything that ran consumed the input; see `Event::consumes`.
|
||||
/// Whether anything that ran used up what triggered it.
|
||||
fn run_event<E: EventLike>(
|
||||
&mut self,
|
||||
id: impl IdLike,
|
||||
|
||||
Reference in new issue
Block a user