mirror of
https://github.com/fafhrd91/actix-web
synced 2024-11-27 09:42:57 +01:00
chore: fix typos (#3248)
This commit is contained in:
parent
e442b00c8c
commit
2915bb7d90
@ -372,13 +372,13 @@ You may need to review the [guidance on shared mutable state](https://docs.rs/ac
|
|||||||
HttpServer::new(|| {
|
HttpServer::new(|| {
|
||||||
- App::new()
|
- App::new()
|
||||||
- .data(MyState::default())
|
- .data(MyState::default())
|
||||||
- .service(hander)
|
- .service(handler)
|
||||||
|
|
||||||
+ let my_state: Data<MyState> = Data::new(MyState::default());
|
+ let my_state: Data<MyState> = Data::new(MyState::default());
|
||||||
+
|
+
|
||||||
+ App::new()
|
+ App::new()
|
||||||
+ .app_data(my_state)
|
+ .app_data(my_state)
|
||||||
+ .service(hander)
|
+ .service(handler)
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ pub(crate) type FnDataFactory =
|
|||||||
/// HttpResponse::Ok()
|
/// HttpResponse::Ok()
|
||||||
/// }
|
/// }
|
||||||
///
|
///
|
||||||
/// /// Alteratively, use the `HttpRequest::app_data` method to access data in a handler.
|
/// /// Alternatively, use the `HttpRequest::app_data` method to access data in a handler.
|
||||||
/// async fn index_alt(req: HttpRequest) -> impl Responder {
|
/// async fn index_alt(req: HttpRequest) -> impl Responder {
|
||||||
/// let data = req.app_data::<Data<Mutex<MyData>>>().unwrap();
|
/// let data = req.app_data::<Data<Mutex<MyData>>>().unwrap();
|
||||||
/// let mut my_data = data.lock().unwrap();
|
/// let mut my_data = data.lock().unwrap();
|
||||||
|
@ -20,7 +20,7 @@ use crate::http::header::Accept;
|
|||||||
pub struct Acceptable {
|
pub struct Acceptable {
|
||||||
mime: mime::Mime,
|
mime: mime::Mime,
|
||||||
|
|
||||||
/// Wether to match `*/*` mime type.
|
/// Whether to match `*/*` mime type.
|
||||||
///
|
///
|
||||||
/// Defaults to false because it's not very useful otherwise.
|
/// Defaults to false because it's not very useful otherwise.
|
||||||
match_star_star: bool,
|
match_star_star: bool,
|
||||||
|
@ -2,7 +2,7 @@ use actix_http::{header, uri::Uri, RequestHead};
|
|||||||
|
|
||||||
use super::{Guard, GuardContext};
|
use super::{Guard, GuardContext};
|
||||||
|
|
||||||
/// Creates a guard that matches requests targetting a specific host.
|
/// Creates a guard that matches requests targeting a specific host.
|
||||||
///
|
///
|
||||||
/// # Matching Host
|
/// # Matching Host
|
||||||
/// This guard will:
|
/// This guard will:
|
||||||
|
Loading…
Reference in New Issue
Block a user