mirror of
https://github.com/async-rs/async-std.git
synced 2025-01-16 10:49:55 +00:00
$cargo fix -Z unstable-options --clippy --features unstable
This commit is contained in:
parent
81e3cab00d
commit
c9d958d309
3 changed files with 3 additions and 3 deletions
|
@ -8,6 +8,6 @@ fn main() -> Result<()> {
|
||||||
match (args.nth(1).as_ref().map(String::as_str), args.next()) {
|
match (args.nth(1).as_ref().map(String::as_str), args.next()) {
|
||||||
(Some("client"), None) => client::main(),
|
(Some("client"), None) => client::main(),
|
||||||
(Some("server"), None) => server::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 mut lines = reader.lines();
|
||||||
|
|
||||||
let name = match lines.next().await {
|
let name = match lines.next().await {
|
||||||
None => Err("peer disconnected immediately")?,
|
None => return Err("peer disconnected immediately".into()),
|
||||||
Some(line) => line?,
|
Some(line) => line?,
|
||||||
};
|
};
|
||||||
let (_shutdown_sender, shutdown_receiver) = mpsc::unbounded::<Void>();
|
let (_shutdown_sender, shutdown_receiver) = mpsc::unbounded::<Void>();
|
||||||
|
|
|
@ -13,7 +13,7 @@ use futures::channel::mpsc;
|
||||||
/// Generates a random number in `0..n`.
|
/// Generates a random number in `0..n`.
|
||||||
pub fn random(n: u32) -> u32 {
|
pub fn random(n: u32) -> u32 {
|
||||||
thread_local! {
|
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| {
|
RNG.with(|rng| {
|
||||||
|
|
Loading…
Reference in a new issue