Skip to content

Commit

Permalink
no panic
Browse files Browse the repository at this point in the history
  • Loading branch information
miraclx committed May 9, 2024
1 parent 7da79c0 commit c7a7411
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/dcutr/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
SwarmEvent::NewListenAddr { address, .. } => {
info!(%address, "\x1b[34mswarm\x1b[0m Listening on address");
}
event => panic!("{event:?}"),
event => info!("unexpected: {event:?}"),
}
}
_ = tokio::time::sleep(Duration::from_secs(1)) => {
Expand Down Expand Up @@ -142,7 +142,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
info!(address=%observed_addr, "\x1b[33mrelay\x1b[0m Relay told us our observed address");
learned_observed_addr = true;
}
event => panic!("{event:?}"),
event => info!("unexpected: {event:?}"),
}

if learned_observed_addr && told_relay_observed_addr {
Expand Down Expand Up @@ -221,7 +221,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
SwarmEvent::OutgoingConnectionError { peer_id, error, .. } => {
info!(peer=?peer_id, "\x1b[34mswarm\x1b[0m Outgoing connection failed: {error}");
}
_ => {}
event => info!(?event, "\x1b[34mswarm\x1b[0m"),
};
}
}
Expand Down

0 comments on commit c7a7411

Please sign in to comment.