@@ -405,20 +405,17 @@ mod tests {
405405
406406 #[ test]
407407 fn webrtc_listener_negotiate_works ( ) {
408- let mut local_protocols = vec ! [
408+ let mut local_protocols = [
409409 ProtocolName :: from ( "/13371338/proto/1" ) ,
410410 ProtocolName :: from ( "/sup/proto/1" ) ,
411411 ProtocolName :: from ( "/13371338/proto/2" ) ,
412412 ProtocolName :: from ( "/13371338/proto/3" ) ,
413413 ProtocolName :: from ( "/13371338/proto/4" ) ,
414414 ] ;
415- let message = webrtc_encode_multistream_message (
416- vec ! [
417- Message :: Protocol ( Protocol :: try_from( & b"/13371338/proto/1" [ ..] ) . unwrap( ) ) ,
418- Message :: Protocol ( Protocol :: try_from( & b"/sup/proto/1" [ ..] ) . unwrap( ) ) ,
419- ]
420- . into_iter ( ) ,
421- )
415+ let message = webrtc_encode_multistream_message ( vec ! [
416+ Message :: Protocol ( Protocol :: try_from( & b"/13371338/proto/1" [ ..] ) . unwrap( ) ) ,
417+ Message :: Protocol ( Protocol :: try_from( & b"/sup/proto/1" [ ..] ) . unwrap( ) ) ,
418+ ] )
422419 . unwrap ( )
423420 . freeze ( ) ;
424421
@@ -433,7 +430,7 @@ mod tests {
433430
434431 #[ test]
435432 fn invalid_message ( ) {
436- let mut local_protocols = vec ! [
433+ let mut local_protocols = [
437434 ProtocolName :: from ( "/13371338/proto/1" ) ,
438435 ProtocolName :: from ( "/sup/proto/1" ) ,
439436 ProtocolName :: from ( "/13371338/proto/2" ) ,
@@ -455,7 +452,7 @@ mod tests {
455452
456453 #[ test]
457454 fn only_header_line_received ( ) {
458- let mut local_protocols = vec ! [
455+ let mut local_protocols = [
459456 ProtocolName :: from ( "/13371338/proto/1" ) ,
460457 ProtocolName :: from ( "/sup/proto/1" ) ,
461458 ProtocolName :: from ( "/13371338/proto/2" ) ,
@@ -466,7 +463,7 @@ mod tests {
466463 // send only header line
467464 let mut bytes = BytesMut :: with_capacity ( 32 ) ;
468465 let message = Message :: Header ( HeaderLine :: V1 ) ;
469- let _ = message. encode ( & mut bytes) . map_err ( |_| Error :: InvalidData ) . unwrap ( ) ;
466+ message. encode ( & mut bytes) . map_err ( |_| Error :: InvalidData ) . unwrap ( ) ;
470467
471468 match webrtc_listener_negotiate ( & mut local_protocols. iter ( ) , bytes. freeze ( ) ) {
472469 Err ( error) => assert ! ( std:: matches!(
@@ -481,7 +478,7 @@ mod tests {
481478
482479 #[ test]
483480 fn header_line_missing ( ) {
484- let mut local_protocols = vec ! [
481+ let mut local_protocols = [
485482 ProtocolName :: from ( "/13371338/proto/1" ) ,
486483 ProtocolName :: from ( "/sup/proto/1" ) ,
487484 ProtocolName :: from ( "/13371338/proto/2" ) ,
@@ -495,7 +492,7 @@ mod tests {
495492 Protocol :: try_from( & b"/13371338/proto/1" [ ..] ) . unwrap( ) ,
496493 Protocol :: try_from( & b"/sup/proto/1" [ ..] ) . unwrap( ) ,
497494 ] ) ;
498- let _ = message. encode ( & mut bytes) . map_err ( |_| Error :: InvalidData ) . unwrap ( ) ;
495+ message. encode ( & mut bytes) . map_err ( |_| Error :: InvalidData ) . unwrap ( ) ;
499496
500497 match webrtc_listener_negotiate ( & mut local_protocols. iter ( ) , bytes. freeze ( ) ) {
501498 Err ( error) => assert ! ( std:: matches!(
@@ -510,19 +507,16 @@ mod tests {
510507
511508 #[ test]
512509 fn protocol_not_supported ( ) {
513- let mut local_protocols = vec ! [
510+ let mut local_protocols = [
514511 ProtocolName :: from ( "/13371338/proto/1" ) ,
515512 ProtocolName :: from ( "/sup/proto/1" ) ,
516513 ProtocolName :: from ( "/13371338/proto/2" ) ,
517514 ProtocolName :: from ( "/13371338/proto/3" ) ,
518515 ProtocolName :: from ( "/13371338/proto/4" ) ,
519516 ] ;
520- let message = webrtc_encode_multistream_message (
521- vec ! [ Message :: Protocol (
522- Protocol :: try_from( & b"/13371339/proto/1" [ ..] ) . unwrap( ) ,
523- ) ]
524- . into_iter ( ) ,
525- )
517+ let message = webrtc_encode_multistream_message ( vec ! [ Message :: Protocol (
518+ Protocol :: try_from( & b"/13371339/proto/1" [ ..] ) . unwrap( ) ,
519+ ) ] )
526520 . unwrap ( )
527521 . freeze ( ) ;
528522
0 commit comments