Fix compilation error and remaining test.

Ref. for compilation error:
https://github.com/rust-lang/rust/issues/64552
This commit is contained in:
Denis Kasak 2020-06-20 12:51:02 +02:00
parent 5bd3c49afc
commit 733689870e
2 changed files with 8 additions and 6 deletions

View file

@ -1284,11 +1284,13 @@ impl BaseClient {
match &mut *olm {
Some(o) => {
let room = room.write().await;
let members = room
.joined_members
.keys()
.chain(room.invited_members.keys());
Ok(o.share_group_session(room_id, members).await?)
// XXX: We construct members in a slightly roundabout way instead of chaining the
// iterators directly because of https://github.com/rust-lang/rust/issues/64552
let joined_members = room.joined_members.keys();
let invited_members = room.joined_members.keys();
let members: Vec<&UserId> = joined_members.chain(invited_members).collect();
Ok(o.share_group_session(room_id, members.into_iter()).await?)
}
None => panic!("Olm machine wasn't started"),
}

View file

@ -93,7 +93,7 @@ pub enum CustomOrRawEvent<'c> {
/// {
/// let name = {
/// let room = room.read().await;
/// let member = room.members.get(&sender).unwrap();
/// let member = room.joined_members.get(&sender).unwrap();
/// member
/// .display_name
/// .as_ref()