1
0
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:
John Vandenberg 2024-01-16 19:29:06 +08:00 committed by GitHub
parent e442b00c8c
commit 2915bb7d90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 5 deletions

View File

@ -372,13 +372,13 @@ You may need to review the [guidance on shared mutable state](https://docs.rs/ac
HttpServer::new(|| {
- App::new()
- .data(MyState::default())
- .service(hander)
- .service(handler)
+ let my_state: Data<MyState> = Data::new(MyState::default());
+
+ App::new()
+ .app_data(my_state)
+ .service(hander)
+ .service(handler)
})
```

View File

@ -69,7 +69,7 @@ pub(crate) type FnDataFactory =
/// 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 {
/// let data = req.app_data::<Data<Mutex<MyData>>>().unwrap();
/// let mut my_data = data.lock().unwrap();

View File

@ -20,7 +20,7 @@ use crate::http::header::Accept;
pub struct Acceptable {
mime: mime::Mime,
/// Wether to match `*/*` mime type.
/// Whether to match `*/*` mime type.
///
/// Defaults to false because it's not very useful otherwise.
match_star_star: bool,

View File

@ -2,7 +2,7 @@ use actix_http::{header, uri::Uri, RequestHead};
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
/// This guard will: