mirror of
https://github.com/actix/examples
synced 2025-06-26 17:17:42 +02:00
chore: fmt
This commit is contained in:
@ -1,11 +1,11 @@
|
||||
use actix_web::{
|
||||
App, Error, HttpServer, Responder,
|
||||
body::{self, MessageBody},
|
||||
dev::{self, ServiceResponse},
|
||||
middleware::{from_fn, Logger, Next},
|
||||
middleware::{Logger, Next, from_fn},
|
||||
web::{self, Data, Json},
|
||||
App, Error, HttpServer, Responder,
|
||||
};
|
||||
use aes_gcm_siv::{aead::Aead as _, Aes256GcmSiv, KeyInit as _, Nonce};
|
||||
use aes_gcm_siv::{Aes256GcmSiv, KeyInit as _, Nonce, aead::Aead as _};
|
||||
use base64::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
use std::{fs::File, io::BufReader};
|
||||
|
||||
use actix_web::{dev::Service, get, http, App, HttpResponse, HttpServer};
|
||||
use actix_web::{App, HttpResponse, HttpServer, dev::Service, get, http};
|
||||
use futures_util::future::{self, Either, FutureExt};
|
||||
use rustls::{pki_types::PrivateKeyDer, ServerConfig};
|
||||
use rustls::{ServerConfig, pki_types::PrivateKeyDer};
|
||||
use rustls_pemfile::{certs, pkcs8_private_keys};
|
||||
|
||||
#[get("/")]
|
||||
|
@ -2,9 +2,8 @@ use std::io;
|
||||
|
||||
use actix_governor::{Governor, GovernorConfigBuilder};
|
||||
use actix_web::{
|
||||
middleware,
|
||||
App, HttpResponse, HttpServer, middleware,
|
||||
web::{self},
|
||||
App, HttpResponse, HttpServer,
|
||||
};
|
||||
|
||||
mod rate_limit;
|
||||
|
@ -3,16 +3,16 @@
|
||||
use std::{
|
||||
cell::RefCell,
|
||||
cmp::min,
|
||||
future::{ready, Ready},
|
||||
future::{Ready, ready},
|
||||
};
|
||||
|
||||
use actix_web::{
|
||||
body::EitherBody,
|
||||
dev::{forward_ready, Service, ServiceRequest, ServiceResponse, Transform},
|
||||
Error, HttpResponse,
|
||||
body::EitherBody,
|
||||
dev::{Service, ServiceRequest, ServiceResponse, Transform, forward_ready},
|
||||
};
|
||||
use chrono::{DateTime, Utc};
|
||||
use futures_util::{future::LocalBoxFuture, FutureExt as _, TryFutureExt as _};
|
||||
use futures_util::{FutureExt as _, TryFutureExt as _, future::LocalBoxFuture};
|
||||
|
||||
#[doc(hidden)]
|
||||
pub struct RateLimitService<S> {
|
||||
|
@ -1,11 +1,11 @@
|
||||
use std::{
|
||||
future::{ready, Ready},
|
||||
future::{Ready, ready},
|
||||
task::{Context, Poll},
|
||||
};
|
||||
|
||||
use actix_web::{
|
||||
dev::{Service, ServiceRequest, ServiceResponse, Transform},
|
||||
Error, HttpMessage,
|
||||
dev::{Service, ServiceRequest, ServiceResponse, Transform},
|
||||
};
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
|
@ -1,9 +1,8 @@
|
||||
use std::io;
|
||||
|
||||
use actix_web::{
|
||||
middleware,
|
||||
App, HttpResponse, HttpServer, middleware,
|
||||
web::{self, ReqData},
|
||||
App, HttpResponse, HttpServer,
|
||||
};
|
||||
|
||||
mod add_msg;
|
||||
|
@ -1,11 +1,12 @@
|
||||
use std::time::Duration;
|
||||
|
||||
use actix_web::{
|
||||
App, Error, HttpServer,
|
||||
body::MessageBody,
|
||||
dev,
|
||||
middleware::{from_fn, Next},
|
||||
middleware::{Next, from_fn},
|
||||
rt::time,
|
||||
web, App, Error, HttpServer,
|
||||
web,
|
||||
};
|
||||
|
||||
mod read_request_body;
|
||||
|
@ -1,12 +1,13 @@
|
||||
use std::{
|
||||
future::{ready, Ready},
|
||||
future::{Ready, ready},
|
||||
rc::Rc,
|
||||
};
|
||||
|
||||
use actix_http::h1;
|
||||
use actix_web::{
|
||||
Error,
|
||||
dev::{self, Service, ServiceRequest, ServiceResponse, Transform},
|
||||
web, Error,
|
||||
web,
|
||||
};
|
||||
use futures_util::future::LocalBoxFuture;
|
||||
|
||||
|
@ -1,15 +1,15 @@
|
||||
use std::{
|
||||
future::{ready, Future, Ready},
|
||||
future::{Future, Ready, ready},
|
||||
marker::PhantomData,
|
||||
pin::Pin,
|
||||
task::{Context, Poll},
|
||||
};
|
||||
|
||||
use actix_web::{
|
||||
Error,
|
||||
body::{BodySize, MessageBody},
|
||||
dev::{self, Service, ServiceRequest, ServiceResponse, Transform},
|
||||
web::{Bytes, BytesMut},
|
||||
Error,
|
||||
};
|
||||
use pin_project_lite::pin_project;
|
||||
|
||||
|
@ -1,9 +1,10 @@
|
||||
use std::future::{ready, Ready};
|
||||
use std::future::{Ready, ready};
|
||||
|
||||
use actix_web::{
|
||||
Error, HttpResponse,
|
||||
body::EitherBody,
|
||||
dev::{self, Service, ServiceRequest, ServiceResponse, Transform},
|
||||
http, Error, HttpResponse,
|
||||
http,
|
||||
};
|
||||
use futures_util::future::LocalBoxFuture;
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
use std::future::{ready, Ready};
|
||||
use std::future::{Ready, ready};
|
||||
|
||||
use actix_web::{
|
||||
dev::{self, Service, ServiceRequest, ServiceResponse, Transform},
|
||||
Error,
|
||||
dev::{self, Service, ServiceRequest, ServiceResponse, Transform},
|
||||
};
|
||||
use futures_util::future::LocalBoxFuture;
|
||||
|
||||
|
Reference in New Issue
Block a user