1
0
mirror of https://github.com/actix/examples synced 2024-12-04 10:41:56 +01:00
examples/web-cors/backend/src/user.rs

20 lines
491 B
Rust
Raw Normal View History

2018-05-08 20:08:43 +02:00
use actix_web::{Json, Result};
2018-05-08 20:08:43 +02:00
#[derive(Deserialize, Serialize, Debug)]
2018-04-13 10:03:58 +02:00
pub struct Info {
username: String,
email: String,
password: String,
confirm_password: String,
}
2018-04-13 10:03:58 +02:00
pub fn info(info: Json<Info>) -> Result<Json<Info>> {
println!("=========={:?}=========", info);
2018-05-08 20:08:43 +02:00
Ok(Json(Info {
username: info.username.clone(),
email: info.email.clone(),
password: info.password.clone(),
confirm_password: info.confirm_password.clone(),
}))
}