Skip to content

Commit c7a7411

Browse files
committed
no panic
1 parent 7da79c0 commit c7a7411

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/dcutr/src/main.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
108108
SwarmEvent::NewListenAddr { address, .. } => {
109109
info!(%address, "\x1b[34mswarm\x1b[0m Listening on address");
110110
}
111-
event => panic!("{event:?}"),
111+
event => info!("unexpected: {event:?}"),
112112
}
113113
}
114114
_ = tokio::time::sleep(Duration::from_secs(1)) => {
@@ -142,7 +142,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
142142
info!(address=%observed_addr, "\x1b[33mrelay\x1b[0m Relay told us our observed address");
143143
learned_observed_addr = true;
144144
}
145-
event => panic!("{event:?}"),
145+
event => info!("unexpected: {event:?}"),
146146
}
147147

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

0 commit comments

Comments
 (0)