Skip to content

Commit 391a54a

Browse files
committed
Avoiding get reference of a u16
1 parent 4237843 commit 391a54a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tokio-postgres/src/connect.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@ where
2525

2626
let mut error = None;
2727
for (i, host) in config.host.iter().enumerate() {
28-
let port = *config
28+
let port = config
2929
.port
3030
.get(i)
3131
.or_else(|| config.port.get(0))
32-
.unwrap_or(&5432);
32+
.copied()
33+
.unwrap_or(5432);
3334

3435
let hostname = match host {
3536
Host::Tcp(host) => &**host,

0 commit comments

Comments
 (0)