diff --git a/transports/webrtc-websys/src/connection.rs b/transports/webrtc-websys/src/connection.rs index b858237da635..d0c6ccd2238d 100644 --- a/transports/webrtc-websys/src/connection.rs +++ b/transports/webrtc-websys/src/connection.rs @@ -186,11 +186,11 @@ impl RtcPeerConnection { let certificate = JsFuture::from(certificate_promise).await?; - let mut config = RtcConfiguration::default(); + let config = RtcConfiguration::default(); // wrap certificate in a js Array first before adding it to the config object let certificate_arr = js_sys::Array::new(); certificate_arr.push(&certificate); - config.certificates(&certificate_arr); + config.set_certificates(&certificate_arr); let inner = web_sys::RtcPeerConnection::new_with_configuration(&config)?; @@ -214,8 +214,9 @@ impl RtcPeerConnection { let dc = match negotiated { true => { - let mut options = RtcDataChannelInit::new(); - options.negotiated(true).id(0); // id is only ever set to zero when negotiated is true + let options = RtcDataChannelInit::new(); + options.set_negotiated(true); + options.set_id(0); // id is only ever set to zero when negotiated is true self.inner .create_data_channel_with_data_channel_dict(LABEL, &options) diff --git a/transports/webrtc-websys/src/sdp.rs b/transports/webrtc-websys/src/sdp.rs index 439182ea4dbe..9e63fd92462f 100644 --- a/transports/webrtc-websys/src/sdp.rs +++ b/transports/webrtc-websys/src/sdp.rs @@ -8,8 +8,8 @@ pub(crate) fn answer( server_fingerprint: Fingerprint, client_ufrag: &str, ) -> RtcSessionDescriptionInit { - let mut answer_obj = RtcSessionDescriptionInit::new(RtcSdpType::Answer); - answer_obj.sdp(&libp2p_webrtc_utils::sdp::answer( + let answer_obj = RtcSessionDescriptionInit::new(RtcSdpType::Answer); + answer_obj.set_sdp(&libp2p_webrtc_utils::sdp::answer( addr, server_fingerprint, client_ufrag, @@ -48,8 +48,8 @@ pub(crate) fn offer(offer: String, client_ufrag: &str) -> RtcSessionDescriptionI tracing::trace!(offer=%munged_sdp_offer, "Created SDP offer"); - let mut offer_obj = RtcSessionDescriptionInit::new(RtcSdpType::Offer); - offer_obj.sdp(&munged_sdp_offer); + let offer_obj = RtcSessionDescriptionInit::new(RtcSdpType::Offer); + offer_obj.set_sdp(&munged_sdp_offer); offer_obj } diff --git a/transports/webrtc-websys/src/stream/poll_data_channel.rs b/transports/webrtc-websys/src/stream/poll_data_channel.rs index 9b1e2d8aa4d7..3ec744342eb2 100644 --- a/transports/webrtc-websys/src/stream/poll_data_channel.rs +++ b/transports/webrtc-websys/src/stream/poll_data_channel.rs @@ -144,6 +144,7 @@ impl PollDataChannel { return Poll::Ready(Err(io::ErrorKind::BrokenPipe.into())) } RtcDataChannelState::Open | RtcDataChannelState::__Invalid => {} + _ => {} } if self.overloaded.load(Ordering::SeqCst) {