$cargo fix -Z unstable-options --clippy --features unstable

pull/393/head
k-nasa 5 years ago
parent 81e3cab00d
commit c9d958d309

@ -8,6 +8,6 @@ fn main() -> Result<()> {
match (args.nth(1).as_ref().map(String::as_str), args.next()) {
(Some("client"), None) => client::main(),
(Some("server"), None) => server::main(),
_ => Err("Usage: a-chat [client|server]")?,
_ => Err("Usage: a-chat [client|server]".into()),
}
}

@ -45,7 +45,7 @@ async fn connection_loop(mut broker: Sender<Event>, stream: TcpStream) -> Result
let mut lines = reader.lines();
let name = match lines.next().await {
None => Err("peer disconnected immediately")?,
None => return Err("peer disconnected immediately".into()),
Some(line) => line?,
};
let (_shutdown_sender, shutdown_receiver) = mpsc::unbounded::<Void>();

@ -13,7 +13,7 @@ use futures::channel::mpsc;
/// Generates a random number in `0..n`.
pub fn random(n: u32) -> u32 {
thread_local! {
static RNG: Cell<Wrapping<u32>> = Cell::new(Wrapping(1406868647));
static RNG: Cell<Wrapping<u32>> = Cell::new(Wrapping(1_406_868_647));
}
RNG.with(|rng| {

Loading…
Cancel
Save