File tree Expand file tree Collapse file tree 2 files changed +5
-8
lines changed
media/src/io/sample_builder
webrtc/src/peer_connection Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -373,10 +373,7 @@ impl<T: Depacketizer> SampleBuilder<T> {
373
373
if self . prepared . empty ( ) {
374
374
return None ;
375
375
}
376
- let result = std:: mem:: replace (
377
- & mut self . prepared_samples [ self . prepared . head as usize ] ,
378
- None ,
379
- ) ;
376
+ let result = self . prepared_samples [ self . prepared . head as usize ] . take ( ) ;
380
377
self . prepared . head = self . prepared . head . wrapping_add ( 1 ) ;
381
378
result
382
379
}
Original file line number Diff line number Diff line change @@ -911,7 +911,7 @@ impl RTCPeerConnection {
911
911
let remote_description: RTCSessionDescription ;
912
912
if let Some ( desc) = remote_desc {
913
913
remote_description = desc;
914
- } else {
914
+ } else {
915
915
return Err ( Error :: ErrNoRemoteDescription ) ;
916
916
}
917
917
if use_identity {
@@ -931,7 +931,7 @@ impl RTCPeerConnection {
931
931
. to_connection_role ( ) ;
932
932
if connection_role == ConnectionRole :: Unspecified {
933
933
connection_role = DEFAULT_DTLS_ROLE_ANSWER . to_connection_role ( ) ;
934
- if let Some ( parsed) = remote_description. parsed {
934
+ if let Some ( parsed) = remote_description. parsed {
935
935
if Self :: is_lite_set ( & parsed) && !self . internal . setting_engine . candidates . ice_lite {
936
936
connection_role = DTLSRole :: Server . to_connection_role ( ) ;
937
937
}
@@ -1306,13 +1306,13 @@ impl RTCPeerConnection {
1306
1306
self . current_local_description ( ) . await
1307
1307
}
1308
1308
1309
- pub fn is_lite_set ( desc : & SessionDescription ) -> bool {
1309
+ pub fn is_lite_set ( desc : & SessionDescription ) -> bool {
1310
1310
for a in & desc. attributes {
1311
1311
if a. key . trim ( ) == ATTR_KEY_ICELITE {
1312
1312
return true ;
1313
1313
}
1314
1314
}
1315
- return false ;
1315
+ false
1316
1316
}
1317
1317
1318
1318
/// set_remote_description sets the SessionDescription of the remote peer
You can’t perform that action at this time.
0 commit comments