@@ -706,8 +706,8 @@ pub(crate) fn extract_fingerprint(desc: &SessionDescription) -> Result<(String,
706
706
}
707
707
708
708
for m in & desc. media_descriptions {
709
- if let Some ( fingerprint) = m. attribute ( "fingerprint" ) {
710
- fingerprints. push ( fingerprint. clone ( ) ) ;
709
+ if let Some ( fingerprint) = m. attribute ( "fingerprint" ) . and_then ( |o| o ) {
710
+ fingerprints. push ( fingerprint. to_owned ( ) ) ;
711
711
}
712
712
}
713
713
@@ -744,11 +744,11 @@ pub(crate) async fn extract_ice_details(
744
744
}
745
745
746
746
for m in & desc. media_descriptions {
747
- if let Some ( ufrag) = m. attribute ( "ice-ufrag" ) {
748
- remote_ufrags. push ( ufrag. clone ( ) ) ;
747
+ if let Some ( ufrag) = m. attribute ( "ice-ufrag" ) . and_then ( |o| o ) {
748
+ remote_ufrags. push ( ufrag. to_owned ( ) ) ;
749
749
}
750
- if let Some ( pwd) = m. attribute ( "ice-pwd" ) {
751
- remote_pwds. push ( pwd. clone ( ) ) ;
750
+ if let Some ( pwd) = m. attribute ( "ice-pwd" ) . and_then ( |o| o ) {
751
+ remote_pwds. push ( pwd. to_owned ( ) ) ;
752
752
}
753
753
754
754
for a in & m. attributes {
@@ -800,7 +800,7 @@ pub(crate) fn get_by_mid<'a, 'b>(
800
800
) -> Option < & ' b MediaDescription > {
801
801
if let Some ( parsed) = & desc. parsed {
802
802
for m in & parsed. media_descriptions {
803
- if let Some ( mid) = m. attribute ( ATTR_KEY_MID ) {
803
+ if let Some ( mid) = m. attribute ( ATTR_KEY_MID ) . and_then ( |o| o ) {
804
804
if mid == search_mid {
805
805
return Some ( m) ;
806
806
}
0 commit comments