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> {
373373 if self . prepared . empty ( ) {
374374 return None ;
375375 }
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 ( ) ;
380377 self . prepared . head = self . prepared . head . wrapping_add ( 1 ) ;
381378 result
382379 }
Original file line number Diff line number Diff line change @@ -911,7 +911,7 @@ impl RTCPeerConnection {
911911 let remote_description: RTCSessionDescription ;
912912 if let Some ( desc) = remote_desc {
913913 remote_description = desc;
914- } else {
914+ } else {
915915 return Err ( Error :: ErrNoRemoteDescription ) ;
916916 }
917917 if use_identity {
@@ -931,7 +931,7 @@ impl RTCPeerConnection {
931931 . to_connection_role ( ) ;
932932 if connection_role == ConnectionRole :: Unspecified {
933933 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 {
935935 if Self :: is_lite_set ( & parsed) && !self . internal . setting_engine . candidates . ice_lite {
936936 connection_role = DTLSRole :: Server . to_connection_role ( ) ;
937937 }
@@ -1306,13 +1306,13 @@ impl RTCPeerConnection {
13061306 self . current_local_description ( ) . await
13071307 }
13081308
1309- pub fn is_lite_set ( desc : & SessionDescription ) -> bool {
1309+ pub fn is_lite_set ( desc : & SessionDescription ) -> bool {
13101310 for a in & desc. attributes {
13111311 if a. key . trim ( ) == ATTR_KEY_ICELITE {
13121312 return true ;
13131313 }
13141314 }
1315- return false ;
1315+ false
13161316 }
13171317
13181318 /// set_remote_description sets the SessionDescription of the remote peer
You can’t perform that action at this time.
0 commit comments