11use std:: {
22 collections:: { hash_map:: Entry , HashMap } ,
33 sync:: Arc ,
4- task:: Poll ,
54} ;
65
76use futures:: { stream, FutureExt , StreamExt , TryStreamExt } ;
8- use futures_channel:: mpsc:: { UnboundedReceiver , UnboundedSender } ;
7+ use futures_channel:: mpsc:: UnboundedReceiver ;
98use openssl:: ssl:: { SslConnector , SslMethod , SslVerifyMode } ;
10- use postgres_openssl:: { MakeTlsConnector , TlsStream } ;
9+ use postgres_openssl:: MakeTlsConnector ;
1110use pyo3:: { pyclass, pymethods, Py , PyAny , PyObject , Python } ;
1211use tokio:: { sync:: RwLock , task:: AbortHandle } ;
13- use tokio_postgres:: { AsyncMessage , Client , Config , Connection , NoTls , Socket } ;
12+ use tokio_postgres:: { AsyncMessage , Client , Config } ;
1413
1514use crate :: {
1615 exceptions:: rust_errors:: { RustPSQLDriverError , RustPSQLDriverPyResult } ,
@@ -19,9 +18,6 @@ use crate::{
1918
2019use super :: {
2120 common_options:: SslMode ,
22- transaction_options:: {
23- IsolationLevel , ListenerTransactionConfig , ReadVariant , SynchronousCommit ,
24- } ,
2521 utils:: { build_tls, ConfiguredTLS } ,
2622} ;
2723
@@ -40,7 +36,7 @@ pub struct Listener {
4036}
4137
4238impl Listener {
43- pub fn new (
39+ # [ must_use ] pub fn new (
4440 // name: String,
4541 pg_config : Config ,
4642 ca_file : Option < String > ,
@@ -49,10 +45,10 @@ impl Listener {
4945 ) -> Self {
5046 Listener {
5147 // name: name,
52- pg_config : pg_config ,
53- ca_file : ca_file ,
48+ pg_config,
49+ ca_file,
5450 // transaction_config: transaction_config,
55- ssl_mode : ssl_mode ,
51+ ssl_mode,
5652 channel_callbacks : Default :: default ( ) ,
5753 listen_abort_handler : Default :: default ( ) ,
5854 client : Default :: default ( ) ,
@@ -116,15 +112,15 @@ impl Listener {
116112 match next_element {
117113 Some ( n) => match n {
118114 tokio_postgres:: AsyncMessage :: Notification ( n) => {
119- println ! ( "Notification {:?}" , n ) ;
115+ println ! ( "Notification {n :?}" ) ;
120116 return Ok ( ( ) ) ;
121117 }
122118 _ => {
123- println ! ( "in_in {:?}" , n )
119+ println ! ( "in_in {n :?}" ) ;
124120 }
125121 } ,
126122 _ => {
127- println ! ( "in {:?}" , next_element )
123+ println ! ( "in {next_element :?}" ) ;
128124 }
129125 }
130126
@@ -211,14 +207,14 @@ impl Listener {
211207 match next_element {
212208 Some ( n) => match n {
213209 tokio_postgres:: AsyncMessage :: Notification ( n) => {
214- println ! ( "Notification {:?}" , n ) ;
210+ println ! ( "Notification {n :?}" ) ;
215211 }
216212 _ => {
217- println ! ( "in_in {:?}" , n )
213+ println ! ( "in_in {n :?}" ) ;
218214 }
219215 } ,
220216 _ => {
221- println ! ( "in {:?}" , next_element )
217+ println ! ( "in {next_element :?}" ) ;
222218 }
223219 }
224220 }
0 commit comments