Commit 9577fbb4 authored by David Goulet's avatar David Goulet
Browse files

cargo fmt



Signed-off-by: default avatarDavid Goulet <dgoulet@ev0ke.net>
parent a1605b87
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -71,8 +71,7 @@ impl OnionTunnel {

            // Handle incoming packet. Drain packets as we process them.
            while let Some(packet) = packets.pop_front() {
                if let Some(tcp_socket) = Parser::parse(packet.clone()).take()
                {
                if let Some(tcp_socket) = Parser::parse(packet.clone()).take() {
                    let socket = TcpSocket::new(self.iface.clone(), tcp_socket);
                    self.proxy(socket);
                }
+2 −8
Original line number Diff line number Diff line
@@ -22,15 +22,9 @@ pub struct TcpSocket {
}

impl TcpSocket {
    pub fn new(
        iface: IFace,
        s: smoltcp::socket::TcpSocket<'static>,
    ) -> Self {
    pub fn new(iface: IFace, s: smoltcp::socket::TcpSocket<'static>) -> Self {
        let handle = iface.lock().unwrap().add_socket(s);
        Self {
            handle,
            iface,
        }
        Self { handle, iface }
    }

    fn with<R>(&mut self, f: impl FnOnce(&mut smoltcp::socket::TcpSocket) -> R) -> R {