@@ -251,12 +251,11 @@ mod tests {
251
251
let a = stream:: iter ( vec ! [ 'a' ] ) . boxed ( ) ;
252
252
let b = stream:: iter ( vec ! [ 'b' ] ) . boxed ( ) ;
253
253
let c = stream:: iter ( vec ! [ 'c' ] ) . boxed ( ) ;
254
- set
255
- . attach_stream ( 1u32 , a)
256
- . expect_none ( "Must attach to blank" ) ;
257
- set
258
- . attach_stream ( 2u32 , b)
259
- . expect_none ( "Must attach to non-blank with new key" ) ;
254
+ assert ! ( set. attach_stream( 1u32 , a) . is_none( ) , "Must attach to blank" ) ;
255
+ assert ! (
256
+ set. attach_stream( 2u32 , b) . is_none( ) ,
257
+ "Must attach to non-blank with new key"
258
+ ) ;
260
259
let mut replaced_b = set
261
260
. attach_stream ( 2u32 , c)
262
261
. expect ( "Must overwrite keys and return an old one" ) ;
@@ -288,12 +287,11 @@ mod tests {
288
287
let a = stream:: iter ( vec ! [ 'a' ] ) . boxed ( ) ;
289
288
let b = stream:: iter ( vec ! [ 'b' ] ) . boxed ( ) ;
290
289
let c = stream:: iter ( vec ! [ 'c' ] ) . boxed ( ) ;
291
- set
292
- . attach_stream ( 1u32 , a)
293
- . expect_none ( "Must attach to blank" ) ;
294
- set
295
- . attach_stream ( 2u32 , b)
296
- . expect_none ( "Must attach to non-blank with new key" ) ;
290
+ assert ! ( set. attach_stream( 1u32 , a) . is_none( ) , "Must attach to blank" ) ;
291
+ assert ! (
292
+ set. attach_stream( 2u32 , b) . is_none( ) ,
293
+ "Must attach to non-blank with new key"
294
+ ) ;
297
295
set
298
296
. attach_stream ( 2u32 , c)
299
297
. expect ( "Must replace existing keys" ) ;
@@ -311,13 +309,12 @@ mod tests {
311
309
use std:: sync:: Arc ;
312
310
let set = Arc :: new ( DynamicStreamSet :: < u32 , i32 > :: new ( ) ) ;
313
311
let a = stream:: iter ( vec ! [ 1 , 2 , 3 ] ) . boxed ( ) ;
314
- set
315
- . attach_stream ( 1u32 , a)
316
- . expect_none ( "Must attach to blank" ) ;
312
+ assert ! ( set. attach_stream( 1u32 , a) . is_none( ) , "Must attach to blank" ) ;
317
313
let collected = set. handle ( ) . collect :: < Vec < _ > > ( ) . await ;
318
314
assert_eq ! ( collected. as_slice( ) , & [ ( 1 , 1 ) , ( 1 , 2 ) , ( 1 , 3 ) ] ) ;
319
- set
320
- . detach ( & 1u32 )
321
- . expect_none ( "Must have already detached if polled to empty" ) ;
315
+ assert ! (
316
+ set. detach( & 1u32 ) . is_none( ) ,
317
+ "Must have already detached if polled to empty"
318
+ ) ;
322
319
}
323
320
}
0 commit comments