Abuse a closure instead of abusing options/iterators quite so much
This commit is contained in:
parent
58c41778e7
commit
33c265d3cf
2 changed files with 17 additions and 32 deletions
|
@ -459,10 +459,10 @@ impl Room {
|
|||
self.participant_user_ids.contains(&user_id)
|
||||
}
|
||||
|
||||
pub fn follows(&self, leader_id: PeerId) -> &[PeerId] {
|
||||
pub fn follows(&self, leader_id: PeerId) -> Option<&[PeerId]> {
|
||||
self.follows_by_leader_id
|
||||
.get(&leader_id)
|
||||
.map_or(&[], |v| v.as_slice())
|
||||
.map(|v| v.as_slice())
|
||||
}
|
||||
|
||||
async fn handle_room_updated(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue