@@ -66,7 +66,7 @@ fn crate_server2(port: u16, server_started: Arc<AtomicBool>) -> anyhow::Result<(
6666 server_started. store ( true , Ordering :: Release ) ;
6767
6868 operator. accept (
69- token_alloc. insert ( Token :: Accept ) ,
69+ token_alloc. insert ( Token :: Accept ) as _ ,
7070 listener. as_raw_socket ( ) as _ ,
7171 std:: ptr:: null_mut ( ) ,
7272 std:: ptr:: null_mut ( ) ,
@@ -77,7 +77,7 @@ fn crate_server2(port: u16, server_started: Arc<AtomicBool>) -> anyhow::Result<(
7777 let ( _, mut cq, _) = operator. select ( None , 1 ) ?;
7878 for cqe in & mut cq {
7979 let token_index = cqe. token ;
80- let token = & mut token_alloc[ token_index] ;
80+ let token = & mut token_alloc[ token_index as _ ] ;
8181 match token. clone ( ) {
8282 Token :: Accept => {
8383 println ! ( "server accepted" ) ;
@@ -107,7 +107,7 @@ fn crate_server2(port: u16, server_started: Arc<AtomicBool>) -> anyhow::Result<(
107107 let ret = cqe. result as _ ;
108108 if ret == 0 {
109109 bufpool. push ( buf_index) ;
110- _ = token_alloc. remove ( token_index) ;
110+ _ = token_alloc. remove ( token_index as _ ) ;
111111 println ! ( "shutdown connection1" ) ;
112112 _ = unsafe { closesocket ( fd) } ;
113113 println ! ( "Server closed1" ) ;
@@ -149,7 +149,7 @@ fn crate_server2(port: u16, server_started: Arc<AtomicBool>) -> anyhow::Result<(
149149 . is_err ( )
150150 {
151151 bufpool. push ( buf_index) ;
152- _ = token_alloc. remove ( token_index) ;
152+ _ = token_alloc. remove ( token_index as _ ) ;
153153 println ! ( "shutdown connection2" ) ;
154154 _ = unsafe { closesocket ( fd) } ;
155155 println ! ( "Server closed2" ) ;
0 commit comments