Skip to content

Commit 3df6971

Browse files
committed
Removed unnecessary mut.
1 parent e11ffb4 commit 3df6971

File tree

4 files changed

+38
-38
lines changed

4 files changed

+38
-38
lines changed
12 KB
Binary file not shown.

tokio-postgres/tests/test/main.rs

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ fn smoke_test(s: &str) {
3636
let mut runtime = Runtime::new().unwrap();
3737

3838
let handshake = connect(s);
39-
let (mut client, connection) = runtime.block_on(handshake).unwrap();
39+
let (client, connection) = runtime.block_on(handshake).unwrap();
4040
let connection = connection.map_err(|e| panic!("{}", e));
4141
runtime.handle().spawn(connection).unwrap();
4242

@@ -139,7 +139,7 @@ fn pipelined_prepare() {
139139
let _ = env_logger::try_init();
140140
let mut runtime = Runtime::new().unwrap();
141141

142-
let (mut client, connection) = runtime.block_on(connect("user=postgres")).unwrap();
142+
let (client, connection) = runtime.block_on(connect("user=postgres")).unwrap();
143143
let connection = connection.map_err(|e| panic!("{}", e));
144144
runtime.handle().spawn(connection).unwrap();
145145

@@ -157,7 +157,7 @@ fn insert_select() {
157157
let _ = env_logger::try_init();
158158
let mut runtime = Runtime::new().unwrap();
159159

160-
let (mut client, connection) = runtime.block_on(connect("user=postgres")).unwrap();
160+
let (client, connection) = runtime.block_on(connect("user=postgres")).unwrap();
161161
let connection = connection.map_err(|e| panic!("{}", e));
162162
runtime.handle().spawn(connection).unwrap();
163163

@@ -193,7 +193,7 @@ fn query_portal() {
193193
let _ = env_logger::try_init();
194194
let mut runtime = Runtime::new().unwrap();
195195

196-
let (mut client, connection) = runtime.block_on(connect("user=postgres")).unwrap();
196+
let (client, connection) = runtime.block_on(connect("user=postgres")).unwrap();
197197
let connection = connection.map_err(|e| panic!("{}", e));
198198
runtime.handle().spawn(connection).unwrap();
199199

@@ -237,7 +237,7 @@ fn cancel_query_raw() {
237237
let _ = env_logger::try_init();
238238
let mut runtime = Runtime::new().unwrap();
239239

240-
let (mut client, connection) = runtime.block_on(connect("user=postgres")).unwrap();
240+
let (client, connection) = runtime.block_on(connect("user=postgres")).unwrap();
241241
let connection = connection.map_err(|e| panic!("{}", e));
242242
runtime.handle().spawn(connection).unwrap();
243243

@@ -271,7 +271,7 @@ fn custom_enum() {
271271
let _ = env_logger::try_init();
272272
let mut runtime = Runtime::new().unwrap();
273273

274-
let (mut client, connection) = runtime.block_on(connect("user=postgres")).unwrap();
274+
let (client, connection) = runtime.block_on(connect("user=postgres")).unwrap();
275275
let connection = connection.map_err(|e| panic!("{}", e));
276276
runtime.handle().spawn(connection).unwrap();
277277

@@ -309,7 +309,7 @@ fn custom_domain() {
309309
let _ = env_logger::try_init();
310310
let mut runtime = Runtime::new().unwrap();
311311

312-
let (mut client, connection) = runtime.block_on(connect("user=postgres")).unwrap();
312+
let (client, connection) = runtime.block_on(connect("user=postgres")).unwrap();
313313
let connection = connection.map_err(|e| panic!("{}", e));
314314
runtime.handle().spawn(connection).unwrap();
315315

@@ -336,7 +336,7 @@ fn custom_array() {
336336
let _ = env_logger::try_init();
337337
let mut runtime = Runtime::new().unwrap();
338338

339-
let (mut client, connection) = runtime.block_on(connect("user=postgres")).unwrap();
339+
let (client, connection) = runtime.block_on(connect("user=postgres")).unwrap();
340340
let connection = connection.map_err(|e| panic!("{}", e));
341341
runtime.handle().spawn(connection).unwrap();
342342

@@ -359,7 +359,7 @@ fn custom_composite() {
359359
let _ = env_logger::try_init();
360360
let mut runtime = Runtime::new().unwrap();
361361

362-
let (mut client, connection) = runtime.block_on(connect("user=postgres")).unwrap();
362+
let (client, connection) = runtime.block_on(connect("user=postgres")).unwrap();
363363
let connection = connection.map_err(|e| panic!("{}", e));
364364
runtime.handle().spawn(connection).unwrap();
365365

@@ -400,7 +400,7 @@ fn custom_range() {
400400
let _ = env_logger::try_init();
401401
let mut runtime = Runtime::new().unwrap();
402402

403-
let (mut client, connection) = runtime.block_on(connect("user=postgres")).unwrap();
403+
let (client, connection) = runtime.block_on(connect("user=postgres")).unwrap();
404404
let connection = connection.map_err(|e| panic!("{}", e));
405405
runtime.handle().spawn(connection).unwrap();
406406

@@ -430,7 +430,7 @@ fn custom_simple() {
430430
let _ = env_logger::try_init();
431431
let mut runtime = Runtime::new().unwrap();
432432

433-
let (mut client, connection) = runtime.block_on(connect("user=postgres")).unwrap();
433+
let (client, connection) = runtime.block_on(connect("user=postgres")).unwrap();
434434
let connection = connection.map_err(|e| panic!("{}", e));
435435
runtime.handle().spawn(connection).unwrap();
436436

@@ -447,7 +447,7 @@ fn notifications() {
447447
let _ = env_logger::try_init();
448448
let mut runtime = Runtime::new().unwrap();
449449

450-
let (mut client, mut connection) = runtime.block_on(connect("user=postgres")).unwrap();
450+
let (client, mut connection) = runtime.block_on(connect("user=postgres")).unwrap();
451451

452452
let (tx, rx) = mpsc::unbounded();
453453
let connection = future::poll_fn(move || {
@@ -491,7 +491,7 @@ fn transaction_commit() {
491491
let _ = env_logger::try_init();
492492
let mut runtime = Runtime::new().unwrap();
493493

494-
let (mut client, connection) = runtime.block_on(connect("user=postgres")).unwrap();
494+
let (client, connection) = runtime.block_on(connect("user=postgres")).unwrap();
495495
let connection = connection.map_err(|e| panic!("{}", e));
496496
runtime.handle().spawn(connection).unwrap();
497497

@@ -532,7 +532,7 @@ fn transaction_abort() {
532532
let _ = env_logger::try_init();
533533
let mut runtime = Runtime::new().unwrap();
534534

535-
let (mut client, connection) = runtime.block_on(connect("user=postgres")).unwrap();
535+
let (client, connection) = runtime.block_on(connect("user=postgres")).unwrap();
536536
let connection = connection.map_err(|e| panic!("{}", e));
537537
runtime.handle().spawn(connection).unwrap();
538538

@@ -574,7 +574,7 @@ fn copy_in() {
574574
let _ = env_logger::try_init();
575575
let mut runtime = Runtime::new().unwrap();
576576

577-
let (mut client, connection) = runtime.block_on(connect("user=postgres")).unwrap();
577+
let (client, connection) = runtime.block_on(connect("user=postgres")).unwrap();
578578
let connection = connection.map_err(|e| panic!("{}", e));
579579
runtime.handle().spawn(connection).unwrap();
580580

@@ -621,7 +621,7 @@ fn copy_in_error() {
621621
let _ = env_logger::try_init();
622622
let mut runtime = Runtime::new().unwrap();
623623

624-
let (mut client, connection) = runtime.block_on(connect("user=postgres")).unwrap();
624+
let (client, connection) = runtime.block_on(connect("user=postgres")).unwrap();
625625
let connection = connection.map_err(|e| panic!("{}", e));
626626
runtime.handle().spawn(connection).unwrap();
627627

@@ -664,7 +664,7 @@ fn copy_out() {
664664
let _ = env_logger::try_init();
665665
let mut runtime = Runtime::new().unwrap();
666666

667-
let (mut client, connection) = runtime.block_on(connect("user=postgres")).unwrap();
667+
let (client, connection) = runtime.block_on(connect("user=postgres")).unwrap();
668668
let connection = connection.map_err(|e| panic!("{}", e));
669669
runtime.handle().spawn(connection).unwrap();
670670

@@ -697,7 +697,7 @@ fn transaction_builder_around_moved_client() {
697697
let _ = env_logger::try_init();
698698
let mut runtime = Runtime::new().unwrap();
699699

700-
let (mut client, connection) = runtime.block_on(connect("user=postgres")).unwrap();
700+
let (client, connection) = runtime.block_on(connect("user=postgres")).unwrap();
701701
let connection = connection.map_err(|e| panic!("{}", e));
702702
runtime.handle().spawn(connection).unwrap();
703703

@@ -715,15 +715,15 @@ fn transaction_builder_around_moved_client() {
715715
.prepare("INSERT INTO transaction_foo (name) VALUES ($1), ($2)")
716716
.map(|statement| (client, statement))
717717
})
718-
.and_then(|(mut client, statement)| {
718+
.and_then(|(client, statement)| {
719719
client
720720
.query(&statement, &[&"jim", &"joe"])
721721
.collect()
722722
.map(|_res| client)
723723
});
724724

725725
let transaction = transaction_builder.build(work);
726-
let mut client = runtime.block_on(transaction).unwrap();
726+
let client = runtime.block_on(transaction).unwrap();
727727

728728
let data = runtime
729729
.block_on(
@@ -743,7 +743,7 @@ fn simple_query() {
743743
let _ = env_logger::try_init();
744744
let mut runtime = Runtime::new().unwrap();
745745

746-
let (mut client, connection) = runtime.block_on(connect("user=postgres")).unwrap();
746+
let (client, connection) = runtime.block_on(connect("user=postgres")).unwrap();
747747
let connection = connection.map_err(|e| panic!("{}", e));
748748
runtime.handle().spawn(connection).unwrap();
749749

@@ -821,7 +821,7 @@ fn poll_idle_running() {
821821
let _ = env_logger::try_init();
822822
let mut runtime = Runtime::new().unwrap();
823823

824-
let (mut client, connection) = runtime.block_on(connect("user=postgres")).unwrap();
824+
let (client, connection) = runtime.block_on(connect("user=postgres")).unwrap();
825825
let connection = connection.map_err(|e| panic!("{}", e));
826826
runtime.handle().spawn(connection).unwrap();
827827

@@ -872,7 +872,7 @@ fn poll_idle_new() {
872872
let _ = env_logger::try_init();
873873
let mut runtime = Runtime::new().unwrap();
874874

875-
let (mut client, connection) = runtime.block_on(connect("user=postgres")).unwrap();
875+
let (client, connection) = runtime.block_on(connect("user=postgres")).unwrap();
876876
let connection = connection.map_err(|e| panic!("{}", e));
877877
runtime.handle().spawn(connection).unwrap();
878878

tokio-postgres/tests/test/runtime.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use tokio_postgres::NoTls;
88
fn smoke_test(s: &str) {
99
let mut runtime = Runtime::new().unwrap();
1010
let connect = tokio_postgres::connect(s, NoTls);
11-
let (mut client, connection) = runtime.block_on(connect).unwrap();
11+
let (client, connection) = runtime.block_on(connect).unwrap();
1212
let connection = connection.map_err(|e| panic!("{}", e));
1313
runtime.spawn(connection);
1414

@@ -76,7 +76,7 @@ fn cancel_query() {
7676
let mut runtime = Runtime::new().unwrap();
7777

7878
let connect = tokio_postgres::connect("host=localhost port=5433 user=postgres", NoTls);
79-
let (mut client, connection) = runtime.block_on(connect).unwrap();
79+
let (client, connection) = runtime.block_on(connect).unwrap();
8080
let connection = connection.map_err(|e| panic!("{}", e));
8181
runtime.spawn(connection);
8282

tokio-postgres/tests/test/types/mod.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ where
3434
let mut runtime = Runtime::new().unwrap();
3535

3636
let handshake = connect("user=postgres");
37-
let (mut client, connection) = runtime.block_on(handshake).unwrap();
37+
let (client, connection) = runtime.block_on(handshake).unwrap();
3838
let connection = connection.map_err(|e| panic!("{}", e));
3939
runtime.spawn(connection);
4040

@@ -192,7 +192,7 @@ fn test_borrowed_text() {
192192
let mut runtime = Runtime::new().unwrap();
193193

194194
let handshake = connect("user=postgres");
195-
let (mut client, connection) = runtime.block_on(handshake).unwrap();
195+
let (client, connection) = runtime.block_on(handshake).unwrap();
196196
let connection = connection.map_err(|e| panic!("{}", e));
197197
runtime.spawn(connection);
198198

@@ -209,7 +209,7 @@ fn test_bpchar_params() {
209209
let mut runtime = Runtime::new().unwrap();
210210

211211
let handshake = connect("user=postgres");
212-
let (mut client, connection) = runtime.block_on(handshake).unwrap();
212+
let (client, connection) = runtime.block_on(handshake).unwrap();
213213
let connection = connection.map_err(|e| panic!("{}", e));
214214
runtime.spawn(connection);
215215

@@ -244,7 +244,7 @@ fn test_citext_params() {
244244
let mut runtime = Runtime::new().unwrap();
245245

246246
let handshake = connect("user=postgres");
247-
let (mut client, connection) = runtime.block_on(handshake).unwrap();
247+
let (client, connection) = runtime.block_on(handshake).unwrap();
248248
let connection = connection.map_err(|e| panic!("{}", e));
249249
runtime.spawn(connection);
250250

@@ -292,7 +292,7 @@ fn test_borrowed_bytea() {
292292
let mut runtime = Runtime::new().unwrap();
293293

294294
let handshake = connect("user=postgres");
295-
let (mut client, connection) = runtime.block_on(handshake).unwrap();
295+
let (client, connection) = runtime.block_on(handshake).unwrap();
296296
let connection = connection.map_err(|e| panic!("{}", e));
297297
runtime.spawn(connection);
298298

@@ -352,7 +352,7 @@ where
352352
let mut runtime = Runtime::new().unwrap();
353353

354354
let handshake = connect("user=postgres");
355-
let (mut client, connection) = runtime.block_on(handshake).unwrap();
355+
let (client, connection) = runtime.block_on(handshake).unwrap();
356356
let connection = connection.map_err(|e| panic!("{}", e));
357357
runtime.spawn(connection);
358358

@@ -379,7 +379,7 @@ fn test_pg_database_datname() {
379379
let mut runtime = Runtime::new().unwrap();
380380

381381
let handshake = connect("user=postgres");
382-
let (mut client, connection) = runtime.block_on(handshake).unwrap();
382+
let (client, connection) = runtime.block_on(handshake).unwrap();
383383
let connection = connection.map_err(|e| panic!("{}", e));
384384
runtime.spawn(connection);
385385

@@ -395,7 +395,7 @@ fn test_slice() {
395395
let mut runtime = Runtime::new().unwrap();
396396

397397
let handshake = connect("user=postgres");
398-
let (mut client, connection) = runtime.block_on(handshake).unwrap();
398+
let (client, connection) = runtime.block_on(handshake).unwrap();
399399
let connection = connection.map_err(|e| panic!("{}", e));
400400
runtime.spawn(connection);
401401

@@ -427,7 +427,7 @@ fn test_slice_wrong_type() {
427427
let mut runtime = Runtime::new().unwrap();
428428

429429
let handshake = connect("user=postgres");
430-
let (mut client, connection) = runtime.block_on(handshake).unwrap();
430+
let (client, connection) = runtime.block_on(handshake).unwrap();
431431
let connection = connection.map_err(|e| panic!("{}", e));
432432
runtime.spawn(connection);
433433

@@ -455,7 +455,7 @@ fn test_slice_range() {
455455
let mut runtime = Runtime::new().unwrap();
456456

457457
let handshake = connect("user=postgres");
458-
let (mut client, connection) = runtime.block_on(handshake).unwrap();
458+
let (client, connection) = runtime.block_on(handshake).unwrap();
459459
let connection = connection.map_err(|e| panic!("{}", e));
460460
runtime.spawn(connection);
461461

@@ -512,7 +512,7 @@ fn domain() {
512512
let mut runtime = Runtime::new().unwrap();
513513

514514
let handshake = connect("user=postgres");
515-
let (mut client, connection) = runtime.block_on(handshake).unwrap();
515+
let (client, connection) = runtime.block_on(handshake).unwrap();
516516
let connection = connection.map_err(|e| panic!("{}", e));
517517
runtime.spawn(connection);
518518

@@ -543,7 +543,7 @@ fn composite() {
543543
let mut runtime = Runtime::new().unwrap();
544544

545545
let handshake = connect("user=postgres");
546-
let (mut client, connection) = runtime.block_on(handshake).unwrap();
546+
let (client, connection) = runtime.block_on(handshake).unwrap();
547547
let connection = connection.map_err(|e| panic!("{}", e));
548548
runtime.spawn(connection);
549549

@@ -580,7 +580,7 @@ fn enum_() {
580580
let mut runtime = Runtime::new().unwrap();
581581

582582
let handshake = connect("user=postgres");
583-
let (mut client, connection) = runtime.block_on(handshake).unwrap();
583+
let (client, connection) = runtime.block_on(handshake).unwrap();
584584
let connection = connection.map_err(|e| panic!("{}", e));
585585
runtime.spawn(connection);
586586

0 commit comments

Comments
 (0)