@@ -177,7 +177,7 @@ fn tcp_table(address_family: u32) -> Result<(Vec<u32>, usize)> {
177177 for _ in 0 ..3 {
178178 let mut buffer = vec ! [ 0u32 ; ( byte_len as usize ) . div_ceil( size_of:: <u32 >( ) ) . max( 1 ) ] ;
179179 let mut actual_len = u32:: try_from ( buffer. len ( ) * size_of :: < u32 > ( ) )
180- . map_err ( |_| format ! ( "TCP table buffer is too large" ) ) ?;
180+ . map_err ( |_| "TCP table buffer is too large" . to_string ( ) ) ?;
181181 // SAFETY: The u32-backed buffer has sufficient alignment and capacity
182182 // for the requested byte count. The API writes at most `actual_len`
183183 // bytes and updates it when the table grows concurrently.
@@ -203,9 +203,7 @@ fn tcp_table(address_family: u32) -> Result<(Vec<u32>, usize)> {
203203 byte_len = actual_len;
204204 }
205205
206- Err ( format ! (
207- "GetExtendedTcpTable changed size during three consecutive reads"
208- ) )
206+ Err ( "GetExtendedTcpTable changed size during three consecutive reads" . to_string ( ) )
209207}
210208
211209fn table_rows < T : Copy > (
@@ -215,7 +213,7 @@ fn table_rows<T: Copy>(
215213 row_stride : usize ,
216214) -> Result < Vec < T > > {
217215 if byte_len < size_of :: < u32 > ( ) {
218- return Err ( format ! ( "Windows TCP table is missing its header" ) ) ;
216+ return Err ( "Windows TCP table is missing its header" . to_string ( ) ) ;
219217 }
220218 if row_stride < size_of :: < T > ( ) {
221219 return Err ( format ! (
@@ -231,10 +229,10 @@ fn table_rows<T: Copy>(
231229 . checked_add (
232230 ( count - 1 )
233231 . checked_mul ( row_stride)
234- . ok_or_else ( || format ! ( "Windows TCP row count overflow" ) ) ?,
232+ . ok_or_else ( || "Windows TCP row count overflow" . to_string ( ) ) ?,
235233 )
236234 . and_then ( |last_row| last_row. checked_add ( size_of :: < T > ( ) ) )
237- . ok_or_else ( || format ! ( "Windows TCP table size overflow" ) ) ?
235+ . ok_or_else ( || "Windows TCP table size overflow" . to_string ( ) ) ?
238236 } ;
239237 if required > byte_len || required > size_of_val ( buffer) {
240238 return Err ( format ! (
0 commit comments