Skip to content

Commit fe30363

Browse files
committed
Rename TLS to Tls
Rename TLS to Tls to silence clippy.
1 parent f0108de commit fe30363

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/tls.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ pub(crate) struct SwitchableConn<T: Read + Write>(Option<EitherConn<T>>);
1717

1818
pub(crate) enum EitherConn<T: Read + Write> {
1919
Plain(T),
20-
TLS(rustls::StreamOwned<ServerConnection, T>),
20+
Tls(rustls::StreamOwned<ServerConnection, T>),
2121
}
2222

2323
impl<T: Read + Write> Read for SwitchableConn<T> {
2424
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
2525
match &mut self.0.as_mut().unwrap() {
2626
EitherConn::Plain(p) => p.read(buf),
27-
EitherConn::TLS(t) => t.read(buf),
27+
EitherConn::Tls(t) => t.read(buf),
2828
}
2929
}
3030
}
@@ -33,14 +33,14 @@ impl<T: Read + Write> Write for SwitchableConn<T> {
3333
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
3434
match &mut self.0.as_mut().unwrap() {
3535
EitherConn::Plain(p) => p.write(buf),
36-
EitherConn::TLS(t) => t.write(buf),
36+
EitherConn::Tls(t) => t.write(buf),
3737
}
3838
}
3939

4040
fn flush(&mut self) -> io::Result<()> {
4141
match &mut self.0.as_mut().unwrap() {
4242
EitherConn::Plain(p) => p.flush(),
43-
EitherConn::TLS(t) => t.flush(),
43+
EitherConn::Tls(t) => t.flush(),
4444
}
4545
}
4646
}
@@ -52,8 +52,8 @@ impl<T: Read + Write> SwitchableConn<T> {
5252

5353
pub fn switch_to_tls(&mut self, config: Arc<ServerConfig>) -> io::Result<()> {
5454
let replacement = match self.0.take() {
55-
Some(EitherConn::Plain(plain)) => Ok(EitherConn::TLS(create_stream(plain, config)?)),
56-
Some(EitherConn::TLS(_)) => Err(io::Error::new(
55+
Some(EitherConn::Plain(plain)) => Ok(EitherConn::Tls(create_stream(plain, config)?)),
56+
Some(EitherConn::Tls(_)) => Err(io::Error::new(
5757
io::ErrorKind::Other,
5858
"tls variant found when plain was expected",
5959
)),

0 commit comments

Comments
 (0)