1
0
mirror of https://github.com/actix/actix-website synced 2025-06-27 15:39:02 +02:00

Minor wording recommendations (#184)

Co-authored-by: Rob Ede <robjtede@icloud.com>
This commit is contained in:
Michael Snoyman
2020-09-04 15:19:43 +03:00
committed by GitHub
parent 32b299e14f
commit d659d04649
4 changed files with 26 additions and 25 deletions

View File

@ -1,7 +1,7 @@
// <config>
use actix_web::{web, App, HttpResponse, HttpServer};
// this function could be located in different module
// this function could be located in a different module
fn scoped_config(cfg: &mut web::ServiceConfig) {
cfg.service(
web::resource("/test")
@ -10,7 +10,7 @@ fn scoped_config(cfg: &mut web::ServiceConfig) {
);
}
// this function could be located in different module
// this function could be located in a different module
fn config(cfg: &mut web::ServiceConfig) {
cfg.service(
web::resource("/app")

View File

@ -37,6 +37,7 @@ async fn _main() -> std::io::Result<()> {
HttpServer::new(move || {
// move counter into the closure
App::new()
// Note: using app_data instead of data
.app_data(counter.clone()) // <- register the created data
.route("/", web::get().to(_index))
})