@@ -545,7 +545,7 @@ mod tests {
545545 use DescriptorType :: * ;
546546
547547 let memory_start_addr = GuestAddress ( 0x0 ) ;
548- let memory = GuestMemoryMmap :: from_ranges ( & vec ! [ ( memory_start_addr, 0x10000 ) ] ) . unwrap ( ) ;
548+ let memory = GuestMemoryMmap :: from_ranges ( & [ ( memory_start_addr, 0x10000 ) ] ) . unwrap ( ) ;
549549
550550 let chain = create_descriptor_chain (
551551 & memory,
@@ -564,7 +564,7 @@ mod tests {
564564 assert_eq ! ( reader. available_bytes( ) , 106 ) ;
565565 assert_eq ! ( reader. bytes_read( ) , 0 ) ;
566566
567- let mut buffer = [ 0 as u8 ; 64 ] ;
567+ let mut buffer = [ 0_u8 ; 64 ] ;
568568 if let Err ( _) = reader. read_exact ( & mut buffer) {
569569 panic ! ( "read_exact should not fail here" ) ;
570570 }
@@ -586,7 +586,7 @@ mod tests {
586586 use DescriptorType :: * ;
587587
588588 let memory_start_addr = GuestAddress ( 0x0 ) ;
589- let memory = GuestMemoryMmap :: from_ranges ( & vec ! [ ( memory_start_addr, 0x10000 ) ] ) . unwrap ( ) ;
589+ let memory = GuestMemoryMmap :: from_ranges ( & [ ( memory_start_addr, 0x10000 ) ] ) . unwrap ( ) ;
590590
591591 let chain = create_descriptor_chain (
592592 & memory,
@@ -605,7 +605,7 @@ mod tests {
605605 assert_eq ! ( writer. available_bytes( ) , 106 ) ;
606606 assert_eq ! ( writer. bytes_written( ) , 0 ) ;
607607
608- let mut buffer = [ 0 as u8 ; 64 ] ;
608+ let mut buffer = [ 0_u8 ; 64 ] ;
609609 if let Err ( _) = writer. write_all ( & mut buffer) {
610610 panic ! ( "write_all should not fail here" ) ;
611611 }
@@ -627,7 +627,7 @@ mod tests {
627627 use DescriptorType :: * ;
628628
629629 let memory_start_addr = GuestAddress ( 0x0 ) ;
630- let memory = GuestMemoryMmap :: from_ranges ( & vec ! [ ( memory_start_addr, 0x10000 ) ] ) . unwrap ( ) ;
630+ let memory = GuestMemoryMmap :: from_ranges ( & [ ( memory_start_addr, 0x10000 ) ] ) . unwrap ( ) ;
631631
632632 let chain = create_descriptor_chain (
633633 & memory,
@@ -652,7 +652,7 @@ mod tests {
652652 use DescriptorType :: * ;
653653
654654 let memory_start_addr = GuestAddress ( 0x0 ) ;
655- let memory = GuestMemoryMmap :: from_ranges ( & vec ! [ ( memory_start_addr, 0x10000 ) ] ) . unwrap ( ) ;
655+ let memory = GuestMemoryMmap :: from_ranges ( & [ ( memory_start_addr, 0x10000 ) ] ) . unwrap ( ) ;
656656
657657 let chain = create_descriptor_chain (
658658 & memory,
@@ -677,7 +677,7 @@ mod tests {
677677 use DescriptorType :: * ;
678678
679679 let memory_start_addr = GuestAddress ( 0x0 ) ;
680- let memory = GuestMemoryMmap :: from_ranges ( & vec ! [ ( memory_start_addr, 0x10000 ) ] ) . unwrap ( ) ;
680+ let memory = GuestMemoryMmap :: from_ranges ( & [ ( memory_start_addr, 0x10000 ) ] ) . unwrap ( ) ;
681681
682682 let chain = create_descriptor_chain (
683683 & memory,
@@ -725,7 +725,7 @@ mod tests {
725725 use DescriptorType :: * ;
726726
727727 let memory_start_addr = GuestAddress ( 0x0 ) ;
728- let memory = GuestMemoryMmap :: from_ranges ( & vec ! [ ( memory_start_addr, 0x10000 ) ] ) . unwrap ( ) ;
728+ let memory = GuestMemoryMmap :: from_ranges ( & [ ( memory_start_addr, 0x10000 ) ] ) . unwrap ( ) ;
729729
730730 let secret: Le32 = 0x12345678 . into ( ) ;
731731
@@ -764,7 +764,7 @@ mod tests {
764764 use DescriptorType :: * ;
765765
766766 let memory_start_addr = GuestAddress ( 0x0 ) ;
767- let memory = GuestMemoryMmap :: from_ranges ( & vec ! [ ( memory_start_addr, 0x10000 ) ] ) . unwrap ( ) ;
767+ let memory = GuestMemoryMmap :: from_ranges ( & [ ( memory_start_addr, 0x10000 ) ] ) . unwrap ( ) ;
768768
769769 let chain = create_descriptor_chain (
770770 & memory,
@@ -794,7 +794,7 @@ mod tests {
794794 use DescriptorType :: * ;
795795
796796 let memory_start_addr = GuestAddress ( 0x0 ) ;
797- let memory = GuestMemoryMmap :: from_ranges ( & vec ! [ ( memory_start_addr, 0x10000 ) ] ) . unwrap ( ) ;
797+ let memory = GuestMemoryMmap :: from_ranges ( & [ ( memory_start_addr, 0x10000 ) ] ) . unwrap ( ) ;
798798
799799 let chain = create_descriptor_chain (
800800 & memory,
@@ -823,7 +823,7 @@ mod tests {
823823 use DescriptorType :: * ;
824824
825825 let memory_start_addr = GuestAddress ( 0x0 ) ;
826- let memory = GuestMemoryMmap :: from_ranges ( & vec ! [ ( memory_start_addr, 0x10000 ) ] ) . unwrap ( ) ;
826+ let memory = GuestMemoryMmap :: from_ranges ( & [ ( memory_start_addr, 0x10000 ) ] ) . unwrap ( ) ;
827827
828828 let chain = create_descriptor_chain (
829829 & memory,
@@ -852,7 +852,7 @@ mod tests {
852852 use DescriptorType :: * ;
853853
854854 let memory_start_addr = GuestAddress ( 0x0 ) ;
855- let memory = GuestMemoryMmap :: from_ranges ( & vec ! [ ( memory_start_addr, 0x10000 ) ] ) . unwrap ( ) ;
855+ let memory = GuestMemoryMmap :: from_ranges ( & [ ( memory_start_addr, 0x10000 ) ] ) . unwrap ( ) ;
856856
857857 let chain = create_descriptor_chain (
858858 & memory,
@@ -881,7 +881,7 @@ mod tests {
881881 use DescriptorType :: * ;
882882
883883 let memory_start_addr = GuestAddress ( 0x0 ) ;
884- let memory = GuestMemoryMmap :: from_ranges ( & vec ! [ ( memory_start_addr, 0x10000 ) ] ) . unwrap ( ) ;
884+ let memory = GuestMemoryMmap :: from_ranges ( & [ ( memory_start_addr, 0x10000 ) ] ) . unwrap ( ) ;
885885
886886 let chain = create_descriptor_chain (
887887 & memory,
@@ -910,7 +910,7 @@ mod tests {
910910 use DescriptorType :: * ;
911911
912912 let memory_start_addr = GuestAddress ( 0x0 ) ;
913- let memory = GuestMemoryMmap :: from_ranges ( & vec ! [ ( memory_start_addr, 0x10000 ) ] ) . unwrap ( ) ;
913+ let memory = GuestMemoryMmap :: from_ranges ( & [ ( memory_start_addr, 0x10000 ) ] ) . unwrap ( ) ;
914914
915915 let chain = create_descriptor_chain (
916916 & memory,
@@ -939,7 +939,7 @@ mod tests {
939939 use DescriptorType :: * ;
940940
941941 let memory_start_addr = GuestAddress ( 0x0 ) ;
942- let memory = GuestMemoryMmap :: from_ranges ( & vec ! [ ( memory_start_addr, 0x10000 ) ] ) . unwrap ( ) ;
942+ let memory = GuestMemoryMmap :: from_ranges ( & [ ( memory_start_addr, 0x10000 ) ] ) . unwrap ( ) ;
943943
944944 let chain = create_descriptor_chain (
945945 & memory,
@@ -951,7 +951,7 @@ mod tests {
951951 . expect ( "create_descriptor_chain failed" ) ;
952952 let mut reader = Reader :: new ( & memory, chain) . expect ( "failed to create Reader" ) ;
953953
954- let mut buf = vec ! [ 0u8 ; 64 ] ;
954+ let mut buf = [ 0u8 ; 64 ] ;
955955 assert_eq ! (
956956 reader. read( & mut buf[ ..] ) . expect( "failed to read to buffer" ) ,
957957 48
@@ -963,7 +963,7 @@ mod tests {
963963 use DescriptorType :: * ;
964964
965965 let memory_start_addr = GuestAddress ( 0x0 ) ;
966- let memory = GuestMemoryMmap :: from_ranges ( & vec ! [ ( memory_start_addr, 0x10000 ) ] ) . unwrap ( ) ;
966+ let memory = GuestMemoryMmap :: from_ranges ( & [ ( memory_start_addr, 0x10000 ) ] ) . unwrap ( ) ;
967967
968968 let chain = create_descriptor_chain (
969969 & memory,
@@ -975,7 +975,7 @@ mod tests {
975975 . expect ( "create_descriptor_chain failed" ) ;
976976 let mut writer = Writer :: new ( & memory, chain) . expect ( "failed to create Writer" ) ;
977977
978- let buf = vec ! [ 0xdeu8 ; 64 ] ;
978+ let buf = [ 0xdeu8 ; 64 ] ;
979979 assert_eq ! (
980980 writer. write( & buf[ ..] ) . expect( "failed to write from buffer" ) ,
981981 48
0 commit comments