mirror of
https://github.com/actix/examples
synced 2025-06-26 17:17:42 +02:00
chore: fmt
This commit is contained in:
@ -18,15 +18,17 @@ async fn main() {
|
||||
let mut cmd_rx = UnboundedReceiverStream::new(cmd_rx);
|
||||
|
||||
// run blocking terminal input reader on separate thread
|
||||
let input_thread = thread::spawn(move || loop {
|
||||
let mut cmd = String::with_capacity(32);
|
||||
let input_thread = thread::spawn(move || {
|
||||
loop {
|
||||
let mut cmd = String::with_capacity(32);
|
||||
|
||||
if io::stdin().read_line(&mut cmd).is_err() {
|
||||
log::error!("error reading line");
|
||||
return;
|
||||
if io::stdin().read_line(&mut cmd).is_err() {
|
||||
log::error!("error reading line");
|
||||
return;
|
||||
}
|
||||
|
||||
cmd_tx.send(cmd).unwrap();
|
||||
}
|
||||
|
||||
cmd_tx.send(cmd).unwrap();
|
||||
});
|
||||
|
||||
let (res, mut ws) = awc::Client::new()
|
||||
|
@ -3,8 +3,8 @@ use std::time::{Duration, Instant};
|
||||
use actix_web::web;
|
||||
use actix_ws::Message;
|
||||
use futures_util::{
|
||||
future::{self, Either},
|
||||
StreamExt as _,
|
||||
future::{self, Either},
|
||||
};
|
||||
use tokio::{pin, select, sync::broadcast, time::interval};
|
||||
|
||||
|
@ -6,7 +6,7 @@ use std::io;
|
||||
|
||||
use actix_files::NamedFile;
|
||||
use actix_web::{
|
||||
middleware, rt, web, App, Error, HttpRequest, HttpResponse, HttpServer, Responder,
|
||||
App, Error, HttpRequest, HttpResponse, HttpServer, Responder, middleware, rt, web,
|
||||
};
|
||||
use tokio::sync::broadcast;
|
||||
|
||||
|
Reference in New Issue
Block a user