1
1
use std:: {
2
2
collections:: { hash_map:: Entry , HashMap } ,
3
3
sync:: Arc ,
4
- task:: Poll ,
5
4
} ;
6
5
7
6
use futures:: { stream, FutureExt , StreamExt , TryStreamExt } ;
8
- use futures_channel:: mpsc:: { UnboundedReceiver , UnboundedSender } ;
7
+ use futures_channel:: mpsc:: UnboundedReceiver ;
9
8
use openssl:: ssl:: { SslConnector , SslMethod , SslVerifyMode } ;
10
- use postgres_openssl:: { MakeTlsConnector , TlsStream } ;
9
+ use postgres_openssl:: MakeTlsConnector ;
11
10
use pyo3:: { pyclass, pymethods, Py , PyAny , PyObject , Python } ;
12
11
use tokio:: { sync:: RwLock , task:: AbortHandle } ;
13
- use tokio_postgres:: { AsyncMessage , Client , Config , Connection , NoTls , Socket } ;
12
+ use tokio_postgres:: { AsyncMessage , Client , Config } ;
14
13
15
14
use crate :: {
16
15
exceptions:: rust_errors:: { RustPSQLDriverError , RustPSQLDriverPyResult } ,
@@ -19,9 +18,6 @@ use crate::{
19
18
20
19
use super :: {
21
20
common_options:: SslMode ,
22
- transaction_options:: {
23
- IsolationLevel , ListenerTransactionConfig , ReadVariant , SynchronousCommit ,
24
- } ,
25
21
utils:: { build_tls, ConfiguredTLS } ,
26
22
} ;
27
23
@@ -40,7 +36,7 @@ pub struct Listener {
40
36
}
41
37
42
38
impl Listener {
43
- pub fn new (
39
+ # [ must_use ] pub fn new (
44
40
// name: String,
45
41
pg_config : Config ,
46
42
ca_file : Option < String > ,
@@ -49,10 +45,10 @@ impl Listener {
49
45
) -> Self {
50
46
Listener {
51
47
// name: name,
52
- pg_config : pg_config ,
53
- ca_file : ca_file ,
48
+ pg_config,
49
+ ca_file,
54
50
// transaction_config: transaction_config,
55
- ssl_mode : ssl_mode ,
51
+ ssl_mode,
56
52
channel_callbacks : Default :: default ( ) ,
57
53
listen_abort_handler : Default :: default ( ) ,
58
54
client : Default :: default ( ) ,
@@ -116,15 +112,15 @@ impl Listener {
116
112
match next_element {
117
113
Some ( n) => match n {
118
114
tokio_postgres:: AsyncMessage :: Notification ( n) => {
119
- println ! ( "Notification {:?}" , n ) ;
115
+ println ! ( "Notification {n :?}" ) ;
120
116
return Ok ( ( ) ) ;
121
117
}
122
118
_ => {
123
- println ! ( "in_in {:?}" , n )
119
+ println ! ( "in_in {n :?}" ) ;
124
120
}
125
121
} ,
126
122
_ => {
127
- println ! ( "in {:?}" , next_element )
123
+ println ! ( "in {next_element :?}" ) ;
128
124
}
129
125
}
130
126
@@ -211,14 +207,14 @@ impl Listener {
211
207
match next_element {
212
208
Some ( n) => match n {
213
209
tokio_postgres:: AsyncMessage :: Notification ( n) => {
214
- println ! ( "Notification {:?}" , n ) ;
210
+ println ! ( "Notification {n :?}" ) ;
215
211
}
216
212
_ => {
217
- println ! ( "in_in {:?}" , n )
213
+ println ! ( "in_in {n :?}" ) ;
218
214
}
219
215
} ,
220
216
_ => {
221
- println ! ( "in {:?}" , next_element )
217
+ println ! ( "in {next_element :?}" ) ;
222
218
}
223
219
}
224
220
}
0 commit comments