@@ -6,6 +6,7 @@ import ip = net_ip;
6
6
import uv:: iotask;
7
7
import uv:: iotask:: iotask;
8
8
import comm:: methods;
9
+ import future_spawn = future:: spawn;
9
10
import future:: future;
10
11
import result:: { result, err, ok, extensions} ;
11
12
@@ -248,9 +249,9 @@ A `future` value that, once the `write` operation completes, resolves to a
248
249
value as the `err` variant
249
250
" ]
250
251
fn write_future ( sock : tcp_socket , raw_write_data : [ u8 ] /~)
251
- -> future:: future < result:: result < ( ) , tcp_err_data > > unsafe {
252
+ -> future < result:: result < ( ) , tcp_err_data > > unsafe {
252
253
let socket_data_ptr = ptr:: addr_of ( * ( sock. socket_data ) ) ;
253
- future :: spawn { ||
254
+ future_spawn { ||
254
255
write_common_impl ( socket_data_ptr, raw_write_data)
255
256
}
256
257
}
@@ -337,9 +338,9 @@ Otherwise, use the blocking `tcp::read` function instead.
337
338
read attempt. Pass `0u` to wait indefinitely
338
339
" ]
339
340
fn read_future ( sock : tcp_socket , timeout_msecs : uint )
340
- -> future:: future < result:: result < [ u8 ] /~, tcp_err_data > > {
341
+ -> future < result:: result < [ u8 ] /~, tcp_err_data > > {
341
342
let socket_data = ptr:: addr_of ( * ( sock. socket_data ) ) ;
342
- future :: spawn { ||
343
+ future_spawn { ||
343
344
read_common_impl ( socket_data, timeout_msecs)
344
345
}
345
346
}
@@ -802,15 +803,15 @@ impl sock_methods for tcp_socket {
802
803
read ( self , timeout_msecs)
803
804
}
804
805
fn read_future ( timeout_msecs : uint ) ->
805
- future:: future < result:: result < [ u8 ] /~, tcp_err_data > > {
806
+ future < result:: result < [ u8 ] /~, tcp_err_data > > {
806
807
read_future ( self , timeout_msecs)
807
808
}
808
809
fn write ( raw_write_data : [ u8 ] /~)
809
810
-> result:: result < ( ) , tcp_err_data > {
810
811
write ( self , raw_write_data)
811
812
}
812
813
fn write_future ( raw_write_data : [ u8 ] /~)
813
- -> future:: future < result:: result < ( ) , tcp_err_data > > {
814
+ -> future < result:: result < ( ) , tcp_err_data > > {
814
815
write_future ( self , raw_write_data)
815
816
}
816
817
}
0 commit comments