]> git.lizzy.rs Git - connect-rs.git/commitdiff
run cargo fmt
authorSachandhan Ganesh <sachan.ganesh@gmail.com>
Thu, 21 Jan 2021 02:23:23 +0000 (18:23 -0800)
committerSachandhan Ganesh <sachan.ganesh@gmail.com>
Thu, 21 Jan 2021 02:24:17 +0000 (18:24 -0800)
examples/tls-echo-server/src/main.rs
src/tcp/server.rs
src/tls/server.rs

index ef0cfef86330bf11a4ec6770f4f65ef458179d75..74326afc863602d5a19978d30d120a2bbe12fd56 100644 (file)
@@ -62,9 +62,7 @@ async fn main() -> anyhow::Result<()> {
                 });
             }
 
-            None => {
-                break
-            }
+            None => break,
         }
     }
 
index d7b0269d6ed9d3e07763aaf333d70bf336adeabd..00c766e3ff3043e5b9bcad0c56259ed13771d75c 100644 (file)
@@ -36,18 +36,23 @@ impl Stream for TcpServer {
     fn poll_next(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
         match futures::executor::block_on(self.listener.incoming().next()) {
             Some(Ok(tcp_stream)) => {
-                let peer_addr = tcp_stream.peer_addr().expect("Could not retrieve peer IP address");
+                let peer_addr = tcp_stream
+                    .peer_addr()
+                    .expect("Could not retrieve peer IP address");
                 debug!("Received connection attempt from {}", peer_addr);
 
                 Poll::Ready(Some(Connection::from(tcp_stream)))
-            },
+            }
 
             Some(Err(e)) => {
-                error!("Encountered error when trying to accept new connection {}", e);
+                error!(
+                    "Encountered error when trying to accept new connection {}",
+                    e
+                );
                 Poll::Pending
             }
 
-            None => Poll::Ready(None)
+            None => Poll::Ready(None),
         }
     }
 }
index a2351f7347b447e1b02938126387f892f88113fa..55647f00456f2dc6f8e0af095bac62478d39ad9f 100644 (file)
@@ -57,7 +57,9 @@ impl Stream for TlsServer {
     fn poll_next(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
         match futures::executor::block_on(self.listener.incoming().next()) {
             Some(Ok(tcp_stream)) => {
-                let peer_addr = tcp_stream.peer_addr().expect("Could not retrieve peer IP address");
+                let peer_addr = tcp_stream
+                    .peer_addr()
+                    .expect("Could not retrieve peer IP address");
                 debug!("Received connection attempt from {}", peer_addr);
 
                 match futures::executor::block_on(self.acceptor.accept(tcp_stream)) {
@@ -75,14 +77,17 @@ impl Stream for TlsServer {
                         Poll::Pending
                     }
                 }
-            },
+            }
 
             Some(Err(e)) => {
-                error!("Encountered error when trying to accept new connection {}", e);
+                error!(
+                    "Encountered error when trying to accept new connection {}",
+                    e
+                );
                 Poll::Pending
             }
 
-            None => Poll::Ready(None)
+            None => Poll::Ready(None),
         }
     }
 }