1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-11-22 17:41:11 +00: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(|| { 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)
}) })
``` ```

View file

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

View file

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

View file

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