mirror of
https://github.com/actix/actix-website
synced 2025-06-27 15:39:02 +02:00
improve extractors docs
This commit is contained in:
@ -1,8 +1,10 @@
|
||||
// <arc>
|
||||
use actix_web::{get, web, App, HttpServer, Responder};
|
||||
use std::cell::Cell;
|
||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||
use std::sync::Arc;
|
||||
use std::{
|
||||
cell::Cell,
|
||||
sync::atomic::{AtomicUsize, Ordering},
|
||||
sync::Arc,
|
||||
};
|
||||
|
||||
#[derive(Clone)]
|
||||
struct AppState {
|
||||
|
@ -1,6 +1,6 @@
|
||||
pub mod handlers_arc;
|
||||
// <data>
|
||||
use actix_web::{web, Responder};
|
||||
use actix_web::{web, App, HttpServer, Responder};
|
||||
use std::cell::Cell;
|
||||
|
||||
#[derive(Clone)]
|
||||
@ -21,8 +21,6 @@ async fn add_one(data: web::Data<AppState>) -> impl Responder {
|
||||
|
||||
#[actix_web::main]
|
||||
async fn main() -> std::io::Result<()> {
|
||||
use actix_web::{App, HttpServer};
|
||||
|
||||
let data = AppState {
|
||||
count: Cell::new(0),
|
||||
};
|
||||
|
Reference in New Issue
Block a user