@@ -53,10 +53,10 @@ async fn ws_subscription_works() {
53
53
let mut foo_sub: Subscription < u64 > = client. subscribe ( "subscribe_foo" , None , "unsubscribe_foo" ) . await . unwrap ( ) ;
54
54
55
55
for _ in 0 ..10 {
56
- let hello = hello_sub. next ( ) . await . unwrap ( ) ;
57
- let foo = foo_sub. next ( ) . await . unwrap ( ) ;
58
- assert_eq ! ( hello, Some ( "hello from subscription" . into ( ) ) ) ;
59
- assert_eq ! ( foo, Some ( 1337 ) ) ;
56
+ let hello = hello_sub. next ( ) . await . unwrap ( ) . unwrap ( ) ;
57
+ let foo = foo_sub. next ( ) . await . unwrap ( ) . unwrap ( ) ;
58
+ assert_eq ! ( hello, "hello from subscription" . to_string ( ) ) ;
59
+ assert_eq ! ( foo, 1337 ) ;
60
60
}
61
61
}
62
62
@@ -181,11 +181,11 @@ async fn ws_subscription_without_polling_doesnt_make_client_unuseable() {
181
181
182
182
// Capacity is `num_sender` + `capacity`
183
183
for _ in 0 ..5 {
184
- assert ! ( hello_sub. next( ) . await . unwrap( ) . is_some ( ) ) ;
184
+ assert ! ( hello_sub. next( ) . await . unwrap( ) . is_ok ( ) ) ;
185
185
}
186
186
187
187
// NOTE: this is now unuseable and unregistered.
188
- assert ! ( hello_sub. next( ) . await . unwrap ( ) . is_none( ) ) ;
188
+ assert ! ( hello_sub. next( ) . await . is_none( ) ) ;
189
189
190
190
// The client should still be useable => make sure it still works.
191
191
let _hello_req: JsonValue = client. request ( "say_hello" , None ) . await . unwrap ( ) ;
@@ -194,7 +194,7 @@ async fn ws_subscription_without_polling_doesnt_make_client_unuseable() {
194
194
let mut other_sub: Subscription < JsonValue > =
195
195
client. subscribe ( "subscribe_hello" , None , "unsubscribe_hello" ) . await . unwrap ( ) ;
196
196
197
- other_sub. next ( ) . await . unwrap ( ) ;
197
+ other_sub. next ( ) . await . unwrap ( ) . unwrap ( ) ;
198
198
}
199
199
200
200
#[ tokio:: test]
@@ -285,7 +285,7 @@ async fn server_should_be_able_to_close_subscriptions() {
285
285
286
286
let res = sub. next ( ) . await ;
287
287
288
- assert ! ( matches!( res, Err ( Error :: SubscriptionClosed ( _) ) ) ) ;
288
+ assert ! ( matches!( res, Some ( Err ( Error :: SubscriptionClosed ( _) ) ) ) ) ;
289
289
}
290
290
291
291
#[ tokio:: test]
@@ -297,7 +297,7 @@ async fn ws_close_pending_subscription_when_server_terminated() {
297
297
298
298
let mut sub: Subscription < String > = c1. subscribe ( "subscribe_hello" , None , "unsubscribe_hello" ) . await . unwrap ( ) ;
299
299
300
- assert ! ( matches!( sub. next( ) . await , Ok ( Some ( _) ) ) ) ;
300
+ assert ! ( matches!( sub. next( ) . await , Some ( Ok ( _) ) ) ) ;
301
301
302
302
handle. stop ( ) . unwrap ( ) . await ;
303
303
@@ -310,7 +310,7 @@ async fn ws_close_pending_subscription_when_server_terminated() {
310
310
for _ in 0 ..2 {
311
311
match sub. next ( ) . await {
312
312
// All good, exit test
313
- Ok ( None ) => return ,
313
+ None => return ,
314
314
// Try again
315
315
_ => continue ,
316
316
}
@@ -352,9 +352,9 @@ async fn ws_server_should_stop_subscription_after_client_drop() {
352
352
353
353
let mut sub: Subscription < usize > = client. subscribe ( "subscribe_hello" , None , "unsubscribe_hello" ) . await . unwrap ( ) ;
354
354
355
- let res = sub. next ( ) . await . unwrap ( ) ;
355
+ let res = sub. next ( ) . await . unwrap ( ) . unwrap ( ) ;
356
356
357
- assert_eq ! ( res. as_ref ( ) , Some ( & 1 ) ) ;
357
+ assert_eq ! ( res, 1 ) ;
358
358
drop ( client) ;
359
359
// assert that the server received `SubscriptionClosed` after the client was dropped.
360
360
assert ! ( matches!( rx. next( ) . await . unwrap( ) , SubscriptionClosedError { .. } ) ) ;
0 commit comments