Skip to content

Commit 5e998f6

Browse files
committed
Simplify native tls connector
1 parent 826788d commit 5e998f6

File tree

1 file changed

+3
-6
lines changed
  • tokio-postgres-native-tls/src

1 file changed

+3
-6
lines changed

tokio-postgres-native-tls/src/lib.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ mod test;
1212

1313
#[cfg(feature = "runtime")]
1414
#[derive(Clone)]
15-
pub struct MakeTlsConnector(tokio_tls::TlsConnector);
15+
pub struct MakeTlsConnector(native_tls::TlsConnector);
1616

1717
#[cfg(feature = "runtime")]
1818
impl MakeTlsConnector {
1919
pub fn new(connector: native_tls::TlsConnector) -> MakeTlsConnector {
20-
MakeTlsConnector(tokio_tls::TlsConnector::from(connector))
20+
MakeTlsConnector(connector)
2121
}
2222
}
2323

@@ -31,10 +31,7 @@ where
3131
type Error = native_tls::Error;
3232

3333
fn make_tls_connect(&mut self, domain: &str) -> Result<TlsConnector, native_tls::Error> {
34-
Ok(TlsConnector {
35-
connector: self.0.clone(),
36-
domain: domain.to_string(),
37-
})
34+
Ok(TlsConnector::new(self.0.clone(), domain))
3835
}
3936
}
4037

0 commit comments

Comments
 (0)