@@ -1265,8 +1265,8 @@ pub(crate) fn dispatch(
12651265 let stream_id = args. first ( ) . map ( |v| v. to_long ( ) ) . unwrap_or ( 0 ) ;
12661266 let seconds = args. get ( 1 ) . map ( |v| v. to_long ( ) ) . unwrap_or ( 0 ) as u64 ;
12671267 let microseconds = args. get ( 2 ) . map ( |v| v. to_long ( ) ) . unwrap_or ( 0 ) as u64 ;
1268- let duration =
1269- std :: time :: Duration :: from_secs ( seconds ) + std:: time:: Duration :: from_micros ( microseconds) ;
1268+ let duration = std :: time :: Duration :: from_secs ( seconds )
1269+ + std:: time:: Duration :: from_micros ( microseconds) ;
12701270 if let Some ( handle) = vm. file_handles . get_mut ( & stream_id) {
12711271 match handle. set_timeout ( duration) {
12721272 Ok ( ( ) ) => Ok ( Some ( Value :: Bool ( true ) ) ) ,
@@ -1303,21 +1303,15 @@ pub(crate) fn dispatch(
13031303 } ,
13041304 Err ( e) => {
13051305 vm. write_back_arg ( 1 , Value :: Long ( 0 ) , ref_args, ref_prop_args) ;
1306- vm. write_back_arg (
1307- 2 ,
1308- Value :: String ( e. to_string ( ) ) ,
1309- ref_args,
1310- ref_prop_args,
1311- ) ;
1306+ vm. write_back_arg ( 2 , Value :: String ( e. to_string ( ) ) , ref_args, ref_prop_args) ;
13121307 return Ok ( Some ( Value :: Bool ( false ) ) ) ;
13131308 }
13141309 } ;
13151310 match std:: net:: TcpStream :: connect_timeout ( & resolved, timeout) {
13161311 Ok ( stream) => {
13171312 let id = vm. next_resource_id ;
13181313 vm. next_resource_id += 1 ;
1319- let handle =
1320- php_rs_ext_standard:: file:: FileHandle :: from_tcp_stream ( stream) ;
1314+ let handle = php_rs_ext_standard:: file:: FileHandle :: from_tcp_stream ( stream) ;
13211315 vm. file_handles . insert ( id, handle) ;
13221316 Ok ( Some ( Value :: Resource ( id, "stream" . to_string ( ) ) ) )
13231317 }
@@ -1328,12 +1322,7 @@ pub(crate) fn dispatch(
13281322 ref_args,
13291323 ref_prop_args,
13301324 ) ;
1331- vm. write_back_arg (
1332- 2 ,
1333- Value :: String ( e. to_string ( ) ) ,
1334- ref_args,
1335- ref_prop_args,
1336- ) ;
1325+ vm. write_back_arg ( 2 , Value :: String ( e. to_string ( ) ) , ref_args, ref_prop_args) ;
13371326 Ok ( Some ( Value :: Bool ( false ) ) )
13381327 }
13391328 }
@@ -1346,8 +1335,7 @@ pub(crate) fn dispatch(
13461335 Ok ( listener) => {
13471336 let id = vm. next_resource_id ;
13481337 vm. next_resource_id += 1 ;
1349- let handle =
1350- php_rs_ext_standard:: file:: FileHandle :: from_tcp_listener ( listener) ;
1338+ let handle = php_rs_ext_standard:: file:: FileHandle :: from_tcp_listener ( listener) ;
13511339 vm. file_handles . insert ( id, handle) ;
13521340 Ok ( Some ( Value :: Resource ( id, "stream" . to_string ( ) ) ) )
13531341 }
@@ -1358,12 +1346,7 @@ pub(crate) fn dispatch(
13581346 ref_args,
13591347 ref_prop_args,
13601348 ) ;
1361- vm. write_back_arg (
1362- 2 ,
1363- Value :: String ( e. to_string ( ) ) ,
1364- ref_args,
1365- ref_prop_args,
1366- ) ;
1349+ vm. write_back_arg ( 2 , Value :: String ( e. to_string ( ) ) , ref_args, ref_prop_args) ;
13671350 Ok ( Some ( Value :: Bool ( false ) ) )
13681351 }
13691352 }
@@ -1374,12 +1357,7 @@ pub(crate) fn dispatch(
13741357 if let Some ( server_handle) = vm. file_handles . get ( & server_id) {
13751358 match server_handle. accept ( ) {
13761359 Ok ( ( client_handle, peer_name) ) => {
1377- vm. write_back_arg (
1378- 2 ,
1379- Value :: String ( peer_name) ,
1380- ref_args,
1381- ref_prop_args,
1382- ) ;
1360+ vm. write_back_arg ( 2 , Value :: String ( peer_name) , ref_args, ref_prop_args) ;
13831361 let id = vm. next_resource_id ;
13841362 vm. next_resource_id += 1 ;
13851363 vm. file_handles . insert ( id, client_handle) ;
@@ -1449,8 +1427,10 @@ pub(crate) fn dispatch(
14491427 None // Block indefinitely
14501428 } else {
14511429 let secs = tv_sec. to_long ( ) ;
1452- Some ( std:: time:: Duration :: from_secs ( secs as u64 )
1453- + std:: time:: Duration :: from_micros ( tv_usec as u64 ) )
1430+ Some (
1431+ std:: time:: Duration :: from_secs ( secs as u64 )
1432+ + std:: time:: Duration :: from_micros ( tv_usec as u64 ) ,
1433+ )
14541434 } ;
14551435
14561436 // Count ready streams from the read array
0 commit comments