Skip to content

Commit

Permalink
examples/file-sharing: Exclude two swarm events from panic (#2580)
Browse files Browse the repository at this point in the history
  • Loading branch information
YoshieraHuang3456 committed Mar 22, 2022
1 parent 0c24821 commit 3abef2e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion examples/file-sharing.rs
Expand Up @@ -138,7 +138,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
network_client.respond_file(file_content, channel).await;
}
}
_ => todo!(),
e => todo!("{:?}", e),
}
}
}
Expand Down Expand Up @@ -499,6 +499,8 @@ mod network {
}
}
}
SwarmEvent::IncomingConnectionError { .. } => {}
SwarmEvent::Dialing(peer_id) => println!("Dialing {}", peer_id),
e => panic!("{:?}", e),
}
}
Expand Down Expand Up @@ -631,6 +633,7 @@ mod network {
},
}

#[derive(Debug)]
pub enum Event {
InboundRequest {
request: String,
Expand Down

0 comments on commit 3abef2e

Please sign in to comment.