Skip to content

Commit ecec4a7

Browse files
committed
Fix build of wgpu_room
Before this change got `cannot create non-exhaustive struct using struct expression` error for construction of `RoomOptions` struct.
1 parent 15a5a7f commit ecec4a7

File tree

1 file changed

+9
-22
lines changed

1 file changed

+9
-22
lines changed

examples/wgpu_room/src/service.rs

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -106,32 +106,19 @@ async fn service_task(inner: Arc<ServiceInner>, mut cmd_rx: mpsc::UnboundedRecei
106106

107107
while let Some(event) = cmd_rx.recv().await {
108108
match event {
109-
AsyncCmd::RoomConnect {
110-
url,
111-
token,
112-
auto_subscribe,
113-
enable_e2ee,
114-
key,
115-
} => {
109+
AsyncCmd::RoomConnect { url, token, auto_subscribe, enable_e2ee, key } => {
116110
log::info!("connecting to room: {}", url);
117111

118112
let key_provider =
119113
KeyProvider::with_shared_key(KeyProviderOptions::default(), key.into_bytes());
120-
let e2ee = enable_e2ee.then_some(E2eeOptions {
121-
encryption_type: EncryptionType::Gcm,
122-
key_provider,
123-
});
124-
125-
let res = Room::connect(
126-
&url,
127-
&token,
128-
RoomOptions {
129-
auto_subscribe,
130-
e2ee,
131-
..Default::default()
132-
},
133-
)
134-
.await;
114+
let e2ee = enable_e2ee
115+
.then_some(E2eeOptions { encryption_type: EncryptionType::Gcm, key_provider });
116+
117+
let mut room_options: RoomOptions = Default::default();
118+
room_options.auto_subscribe = auto_subscribe;
119+
room_options.e2ee = e2ee;
120+
121+
let res = Room::connect(&url, &token, room_options).await;
135122

136123
if let Ok((new_room, events)) = res {
137124
log::info!("connected to room: {}", new_room.name());

0 commit comments

Comments
 (0)