Skip to content

Commit

Permalink
Build with stable
Browse files Browse the repository at this point in the history
  • Loading branch information
vi committed Jan 3, 2020
1 parent a936216 commit d9cadb2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ impl CommunicationActorState {
},
CommunicationActorMessage::ClientData(buf) => {
use rand::Rng;

let mut rng = rand::thread_rng();

// Try sending though a random port
Expand Down Expand Up @@ -147,7 +148,7 @@ pub async fn client(
name: String,
pco: PlayloadCommunicationOptions,
cs: ClientSettings,
) -> Result<!> {
) -> Result<()> {
let sendaddr = pco.sendto;
let bindaddr = if let Some(x) = pco.bind {
x
Expand Down
7 changes: 4 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ struct ServerMetrics {
snderr: u64,
}

async fn server(sa: SocketAddr) -> Result<!> {
async fn server(sa: SocketAddr) -> Result<()> {
use ttl_cache::TtlCache;

type Registry = TtlCache<String, TtlCache<SocketAddr, ()>>;
Expand Down Expand Up @@ -235,7 +235,7 @@ async fn main() -> Result<()> {
if opt.cs.keepalive_interval != 30 {
eprintln!("--keepalive-interval is meaningless in server mode");
}
server(sa).await?
server(sa).await?;
} else {
if opt.name.is_none() {
Err("--name is required in client mode")?;
Expand All @@ -246,6 +246,7 @@ async fn main() -> Result<()> {
let name = opt.name.unwrap();
let sa = opt.client.unwrap();

client::client(sa, name, opt.pco, opt.cs).await?
client::client(sa, name, opt.pco, opt.cs).await?;
}
Ok(())
}

0 comments on commit d9cadb2

Please sign in to comment.