Skip to content

Commit

Permalink
Avoid Panic
Browse files Browse the repository at this point in the history
  • Loading branch information
kanishkarj committed Mar 27, 2019
1 parent bac4dd4 commit 720aedc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tokio-trace-futures/examples/proxy_server.rs
Expand Up @@ -39,7 +39,7 @@ fn main() -> Result<(), Box<std::error::Error>> {
.map_err(|e| debug!(msg = "error accepting socket", error = field::display(e)))
.for_each(move |client| {
let server = TcpStream::connect(&server_addr);
let mut client_addr: Option<SocketAddr> = None;
let mut client_addr = None;
match client.peer_addr() {
Ok(x) => {
client_addr = Some(x);
Expand Down Expand Up @@ -99,7 +99,7 @@ fn main() -> Result<(), Box<std::error::Error>> {
})
.instrument(span!(
"transfer completed",
client_address = field::debug(&client_addr.unwrap()),
client_address = field::debug(&client_addr),
server_address = field::debug(&server_addr)
));

Expand Down

0 comments on commit 720aedc

Please sign in to comment.