state-res: Add some docs and fix a typo

This commit is contained in:
Devin Ragotzy
2021-10-04 16:05:11 -04:00
committed by Jonas Platte
parent 0e1cf5b3f6
commit bdce12b07e
2 changed files with 5 additions and 1 deletions

View File

@@ -331,6 +331,10 @@ struct PowerLevelsContentFields {
}
/// Find the power level for the sender of `event_id` or return a default value of zero.
///
/// Do NOT use this any where but topological sort, we find the power level for the eventId
/// at the eventId's generation (we walk backwards to `EventId`s most recent previous power level
/// event).
fn get_power_level_for_sender<E: Event>(
event_id: &EventId,
fetch_event: impl Fn(&EventId) -> Option<E>,