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:
iris committed 2026-09-13 21:37:21 -04:00
1 parent 36fec09d11
commit 23376aef25
2 files changed
+3 -5

No files matched your search

+2 -4
View File
@@ -9,8 +9,7 @@ pub use rsc::*;
pub trait Event: Sized + 'static + Clone { pub trait Event: Sized + 'static + Clone {
type Data<'a>: Clone = (); type Data<'a>: Clone = ();
type State: Default = (); type State: Default = ();
/// State the whole event type keeps, as opposed to `State`, which each /// State the whole event type keeps, rather than one copy per widget.
/// widget keeps its own of.
type Global: Default = (); type Global: Default = ();
#[allow(unused_variables)] #[allow(unused_variables)]
fn should_run<'a>(&self, data: &Self::Data<'a>) -> Option<Self::Data<'a>> { 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 /// Whether having run on this data uses up whatever triggered it, so
/// nothing further should see it. `run_event` reports back the `or` of /// nothing further should see it.
/// this across everything that ran.
#[allow(unused_variables)] #[allow(unused_variables)]
fn consumes(&self, data: &Self::Data<'_>) -> bool { fn consumes(&self, data: &Self::Data<'_>) -> bool {
false false
+1 -1
View File
@@ -21,7 +21,7 @@ pub trait HasEvents: Sized + UiRsc + HasState {
} }
pub trait RunEvents: HasEvents { 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>( fn run_event<E: EventLike>(
&mut self, &mut self,
id: impl IdLike, id: impl IdLike,