From 08262588e3c719e2eb72e58aa16ac4b054319439 Mon Sep 17 00:00:00 2001 From: Arniu Date: Tue, 22 Sep 2020 23:15:29 +0800 Subject: [PATCH] fix doctest --- actix-web-codegen/src/lib.rs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/actix-web-codegen/src/lib.rs b/actix-web-codegen/src/lib.rs index 8d9a36b4a..62a1cc5fa 100644 --- a/actix-web-codegen/src/lib.rs +++ b/actix-web-codegen/src/lib.rs @@ -9,8 +9,9 @@ mod route; /// Creates resource handler, allowing multiple HTTP method guards. /// /// ## Syntax -/// -/// #[route("path", method="HTTP_METHOD"[, attributes])] +/// ```text +/// #[route("path", method="HTTP_METHOD"[, attributes])] +/// ``` /// /// ### Attributes /// - `"path"` - Raw literal string with path for which to register handler. @@ -29,8 +30,8 @@ mod route; /// use actix_web_codegen::route; /// /// #[route("/", method="GET", method="HEAD")] -/// fn async example() -> HttpResponse { -/// Ok(HttpResponse::Ok().finish()) +/// async fn example() -> HttpResponse { +/// HttpResponse::Ok().finish() /// } /// ``` #[proc_macro_attribute] @@ -54,8 +55,9 @@ concat!(" Creates route handler with `actix_web::guard::", stringify!($variant), "`. ## Syntax - - #[", stringify!($method), r#"("path"[, attributes])] +```text +#[", stringify!($method), r#"("path"[, attributes])] +``` ### Attributes - `"path"` - Raw literal string with path for which to register handler. @@ -73,8 +75,8 @@ use actix_web::HttpResponse; use actix_web_codegen::"#, stringify!($method), "; #[", stringify!($method), r#"("/")] -fn async example() -> HttpResponse { - Ok(HttpResponse::Ok().finish()) +async fn example() -> HttpResponse { + HttpResponse::Ok().finish() } ``` "#);