1
0
mirror of https://github.com/actix/examples synced 2025-06-26 17:17:42 +02:00

chore: fmt

This commit is contained in:
Rob Ede
2025-03-21 06:07:31 +00:00
parent a7527d72f3
commit 04f8cba71b
98 changed files with 828 additions and 650 deletions

View File

@ -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()

View File

@ -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};

View File

@ -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;