Skip to content

Commit

Permalink
fix deprecated methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Prabhat1308 committed Aug 23, 2024
1 parent 81cfb6a commit 5f51197
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions transports/webrtc-websys/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ impl RtcPeerConnection {
// 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)?;

Expand All @@ -215,7 +215,8 @@ impl RtcPeerConnection {
let dc = match negotiated {
true => {
let mut options = RtcDataChannelInit::new();

Check failure on line 217 in transports/webrtc-websys/src/connection.rs

View workflow job for this annotation

GitHub Actions / clippy (1.80.0)

variable does not need to be mutable

Check failure on line 217 in transports/webrtc-websys/src/connection.rs

View workflow job for this annotation

GitHub Actions / clippy (beta)

variable does not need to be mutable

Check failure on line 217 in transports/webrtc-websys/src/connection.rs

View workflow job for this annotation

GitHub Actions / Compile with MSRV

variable does not need to be mutable
options.negotiated(true).id(0); // id is only ever set to zero when negotiated is true
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)
Expand Down
4 changes: 2 additions & 2 deletions transports/webrtc-websys/src/sdp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub(crate) fn answer(
client_ufrag: &str,
) -> RtcSessionDescriptionInit {
let mut answer_obj = RtcSessionDescriptionInit::new(RtcSdpType::Answer);

Check failure on line 11 in transports/webrtc-websys/src/sdp.rs

View workflow job for this annotation

GitHub Actions / clippy (1.80.0)

variable does not need to be mutable

Check failure on line 11 in transports/webrtc-websys/src/sdp.rs

View workflow job for this annotation

GitHub Actions / clippy (beta)

variable does not need to be mutable

Check failure on line 11 in transports/webrtc-websys/src/sdp.rs

View workflow job for this annotation

GitHub Actions / Compile with MSRV

variable does not need to be mutable
answer_obj.sdp(&libp2p_webrtc_utils::sdp::answer(
answer_obj.set_sdp(&libp2p_webrtc_utils::sdp::answer(
addr,
server_fingerprint,
client_ufrag,
Expand Down Expand Up @@ -49,7 +49,7 @@ 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);

Check failure on line 51 in transports/webrtc-websys/src/sdp.rs

View workflow job for this annotation

GitHub Actions / clippy (1.80.0)

variable does not need to be mutable

Check failure on line 51 in transports/webrtc-websys/src/sdp.rs

View workflow job for this annotation

GitHub Actions / clippy (beta)

variable does not need to be mutable

Check failure on line 51 in transports/webrtc-websys/src/sdp.rs

View workflow job for this annotation

GitHub Actions / Compile with MSRV

variable does not need to be mutable
offer_obj.sdp(&munged_sdp_offer);
offer_obj.set_sdp(&munged_sdp_offer);

offer_obj
}
1 change: 1 addition & 0 deletions transports/webrtc-websys/src/stream/poll_data_channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ impl PollDataChannel {
return Poll::Ready(Err(io::ErrorKind::BrokenPipe.into()))

Check failure on line 144 in transports/webrtc-websys/src/stream/poll_data_channel.rs

View workflow job for this annotation

GitHub Actions / rustfmt

Diff in /home/runner/work/rust-libp2p/rust-libp2p/transports/webrtc-websys/src/stream/poll_data_channel.rs
}
RtcDataChannelState::Open | RtcDataChannelState::__Invalid => {}
_ => {}
}

if self.overloaded.load(Ordering::SeqCst) {
Expand Down

0 comments on commit 5f51197

Please sign in to comment.