From 086c4f5911b8708308684e9f89a751ad346ed528 Mon Sep 17 00:00:00 2001 From: realaravinth Date: Sat, 10 Sep 2022 18:31:05 +0530 Subject: [PATCH] feat: replace my_codegen with actix_web_codegen_const_routes --- Cargo.lock | 16 ++++++++-------- Cargo.toml | 3 ++- src/deploy.rs | 4 ++-- src/meta.rs | 2 +- src/serve.rs | 2 +- 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 14c9f0c..547d7f8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -144,7 +144,7 @@ dependencies = [ "actix-server", "actix-service", "actix-utils", - "actix-web-codegen 4.0.1", + "actix-web-codegen", "ahash", "bytes", "bytestring", @@ -172,8 +172,9 @@ dependencies = [ [[package]] name = "actix-web-codegen" -version = "4.0.0" -source = "git+https://github.com/realaravinth/actix-web#8a399b6e7ea6ffdf241d07a9e907b1afff7e0fe6" +version = "4.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f270541caec49c15673b0af0e9a00143421ad4f118d2df7edcb68b627632f56" dependencies = [ "actix-router", "proc-macro2", @@ -182,10 +183,9 @@ dependencies = [ ] [[package]] -name = "actix-web-codegen" -version = "4.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f270541caec49c15673b0af0e9a00143421ad4f118d2df7edcb68b627632f56" +name = "actix-web-codegen-const-routes" +version = "0.1.0" +source = "git+https://github.com/realaravinth/actix-web-codegen-const-routes?tag=0.1.0#1cc9b8dbaaef4b3634dabbf537f313200dd91bd9" dependencies = [ "actix-router", "proc-macro2", @@ -920,7 +920,7 @@ dependencies = [ "actix-http", "actix-rt", "actix-web", - "actix-web-codegen 4.0.0", + "actix-web-codegen-const-routes", "config", "derive_more", "git2", diff --git a/Cargo.toml b/Cargo.toml index 8b79aa3..8c8f4a5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,8 @@ authors = ["realaravinth "] actix-web = "4.0.1" actix-http = "3.0.4" actix-rt = "2" -my-codegen = {package = "actix-web-codegen", git ="https://github.com/realaravinth/actix-web"} +actix-web-codegen-const-routes = { version = "0.1.0", tag = "0.1.0", git = "https://github.com/realaravinth/actix-web-codegen-const-routes" } + config = "0.13" git2 = "0.14.2" diff --git a/src/deploy.rs b/src/deploy.rs index 17c3fd0..a8c0b19 100644 --- a/src/deploy.rs +++ b/src/deploy.rs @@ -53,7 +53,7 @@ pub fn find_page<'a>(secret: &str, ctx: &'a AppCtx) -> Option<&'a Page> { None } -#[my_codegen::post(path = "crate::V1_API_ROUTES.deploy.update")] +#[actix_web_codegen_const_routes::post(path = "crate::V1_API_ROUTES.deploy.update")] async fn update(payload: web::Json, ctx: AppCtx) -> ServiceResult { if let Some(page) = find_page(&payload.secret, &ctx) { let (tx, rx) = oneshot::channel(); @@ -98,7 +98,7 @@ impl DeployInfo { } } -#[my_codegen::post(path = "crate::V1_API_ROUTES.deploy.info")] +#[actix_web_codegen_const_routes::post(path = "crate::V1_API_ROUTES.deploy.info")] async fn deploy_info( payload: web::Json, ctx: AppCtx, diff --git a/src/meta.rs b/src/meta.rs index 87c395c..3d9229e 100644 --- a/src/meta.rs +++ b/src/meta.rs @@ -43,7 +43,7 @@ pub mod routes { } /// emmits build details of the bninary -#[my_codegen::get(path = "crate::V1_API_ROUTES.meta.build_details")] +#[actix_web_codegen_const_routes::get(path = "crate::V1_API_ROUTES.meta.build_details")] async fn build_details(ctx: AppCtx) -> impl Responder { let build = BuildDetails { version: VERSION, diff --git a/src/serve.rs b/src/serve.rs index 5fe42d0..07d03ef 100644 --- a/src/serve.rs +++ b/src/serve.rs @@ -47,7 +47,7 @@ pub fn find_page<'a>(domain: &str, ctx: &'a AppCtx) -> Option<&'a Page> { None } -#[my_codegen::get(path = "crate::V1_API_ROUTES.serve.catch_all")] +#[actix_web_codegen_const_routes::get(path = "crate::V1_API_ROUTES.serve.catch_all")] async fn index(req: HttpRequest, ctx: AppCtx) -> ServiceResult { let c = req.connection_info(); let mut host = c.host();