mirror of
https://github.com/actix/actix-website
synced 2025-06-27 07:29:02 +02:00
moves individual examples to pub mods to force building and have less dead_code
This commit is contained in:
@ -2,14 +2,14 @@ use actix_web::{web, App, FromRequest, HttpRequest, HttpServer, Responder};
|
||||
use futures::future::Future;
|
||||
use serde::Deserialize;
|
||||
|
||||
// mod custom_handler;
|
||||
mod form;
|
||||
mod json_one;
|
||||
mod json_two;
|
||||
mod multiple;
|
||||
mod path_one;
|
||||
mod path_two;
|
||||
mod query;
|
||||
// pub mod custom_handler;
|
||||
pub mod form;
|
||||
pub mod json_one;
|
||||
pub mod json_two;
|
||||
pub mod multiple;
|
||||
pub mod path_one;
|
||||
pub mod path_two;
|
||||
pub mod query;
|
||||
|
||||
#[derive(Deserialize, Debug)]
|
||||
struct MyInfo {
|
||||
|
@ -10,7 +10,7 @@ struct Info {
|
||||
|
||||
/// extract path info using serde
|
||||
fn index(info: web::Path<Info>) -> Result<String> {
|
||||
Ok(format!("Welcome {}!", info.friend))
|
||||
Ok(format!("Welcome {}, userid {}!", info.friend, info.userid))
|
||||
}
|
||||
|
||||
pub fn main() {
|
||||
|
Reference in New Issue
Block a user