@@ -48,7 +48,7 @@ fn spsc_unbounded() {
48
48
let ( tx, rx) = mpsc:: unbounded ( ) ;
49
49
50
50
cx. spawn ( future:: lazy ( move |_| {
51
- tx. send_all ( stream:: iter_ok ( ( 0 ..MESSAGES ) . map ( |i| message:: new ( i ) ) ) )
51
+ tx. send_all ( stream:: iter_ok ( ( 0 ..MESSAGES ) . map ( message:: new) ) )
52
52
. map_err ( |_| panic ! ( ) )
53
53
. and_then ( |_| future:: ok ( ( ) ) )
54
54
} ) ) ;
@@ -65,7 +65,7 @@ fn spsc_bounded(cap: usize) {
65
65
let ( tx, rx) = mpsc:: channel ( cap) ;
66
66
67
67
cx. spawn ( future:: lazy ( move |_| {
68
- tx. send_all ( stream:: iter_ok ( ( 0 ..MESSAGES ) . map ( |i| message:: new ( i ) ) ) )
68
+ tx. send_all ( stream:: iter_ok ( ( 0 ..MESSAGES ) . map ( message:: new) ) )
69
69
. map_err ( |_| panic ! ( ) )
70
70
. and_then ( |_| future:: ok ( ( ) ) )
71
71
} ) ) ;
@@ -84,11 +84,9 @@ fn mpsc_unbounded() {
84
84
for _ in 0 ..THREADS {
85
85
let tx = tx. clone ( ) ;
86
86
cx. spawn ( future:: lazy ( move |_| {
87
- tx. send_all ( stream:: iter_ok (
88
- ( 0 ..MESSAGES / THREADS ) . map ( |i| message:: new ( i) ) ,
89
- ) )
90
- . map_err ( |_| panic ! ( ) )
91
- . and_then ( |_| future:: ok ( ( ) ) )
87
+ tx. send_all ( stream:: iter_ok ( ( 0 ..MESSAGES / THREADS ) . map ( message:: new) ) )
88
+ . map_err ( |_| panic ! ( ) )
89
+ . and_then ( |_| future:: ok ( ( ) ) )
92
90
} ) ) ;
93
91
}
94
92
drop ( tx) ;
@@ -107,11 +105,9 @@ fn mpsc_bounded(cap: usize) {
107
105
for _ in 0 ..THREADS {
108
106
let tx = tx. clone ( ) ;
109
107
cx. spawn ( future:: lazy ( move |_| {
110
- tx. send_all ( stream:: iter_ok (
111
- ( 0 ..MESSAGES / THREADS ) . map ( |i| message:: new ( i) ) ,
112
- ) )
113
- . map_err ( |_| panic ! ( ) )
114
- . and_then ( |_| future:: ok ( ( ) ) )
108
+ tx. send_all ( stream:: iter_ok ( ( 0 ..MESSAGES / THREADS ) . map ( message:: new) ) )
109
+ . map_err ( |_| panic ! ( ) )
110
+ . and_then ( |_| future:: ok ( ( ) ) )
115
111
} ) ) ;
116
112
}
117
113
drop ( tx) ;
@@ -153,11 +149,9 @@ fn select_rx_bounded(cap: usize) {
153
149
for ( tx, _) in & chans {
154
150
let tx = tx. clone ( ) ;
155
151
cx. spawn ( future:: lazy ( move |_| {
156
- tx. send_all ( stream:: iter_ok (
157
- ( 0 ..MESSAGES / THREADS ) . map ( |i| message:: new ( i) ) ,
158
- ) )
159
- . map_err ( |_| panic ! ( ) )
160
- . and_then ( |_| future:: ok ( ( ) ) )
152
+ tx. send_all ( stream:: iter_ok ( ( 0 ..MESSAGES / THREADS ) . map ( message:: new) ) )
153
+ . map_err ( |_| panic ! ( ) )
154
+ . and_then ( |_| future:: ok ( ( ) ) )
161
155
} ) ) ;
162
156
}
163
157
0 commit comments