From ac82b56ad7f553e2c7ab2791bbc2a7b8a1e26ab7 Mon Sep 17 00:00:00 2001 From: Jon Lim Date: Sun, 10 Sep 2023 14:15:41 -0700 Subject: [PATCH] Update scope macro code to work with current HttpServiceFactory --- actix-web-codegen/src/route.rs | 4 ++-- actix-web/src/lib.rs | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/actix-web-codegen/src/route.rs b/actix-web-codegen/src/route.rs index d8fb2a5da..1b5b4e2f0 100644 --- a/actix-web-codegen/src/route.rs +++ b/actix-web-codegen/src/route.rs @@ -661,8 +661,8 @@ impl fmt::Display for ScopeArgs { writeln!(f, "{}\n", ast)?; writeln!(f, "#[allow(non_camel_case_types)]")?; writeln!(f, "struct {};\n", self.name)?; - writeln!(f, "impl actix_web::dev::HttpServiceFactory

for {} {{", self.name)?; - writeln!(f, " fn register(self, config: &mut actix_web::dev::ServiceConfig

) {{")?; + writeln!(f, "impl actix_web::dev::HttpServiceFactory for {} {{", self.name)?; + writeln!(f, " fn register(self, config: &mut actix_web::dev::AppService) {{")?; write!(f, " let scope = actix_web::Scope::new(\"{}\")", self.path)?; for handler in self.scope_items.handlers.iter() { diff --git a/actix-web/src/lib.rs b/actix-web/src/lib.rs index e982a43b1..5f099ae01 100644 --- a/actix-web/src/lib.rs +++ b/actix-web/src/lib.rs @@ -143,5 +143,6 @@ codegen_reexport!(delete); codegen_reexport!(trace); codegen_reexport!(connect); codegen_reexport!(options); +codegen_reexport!(scope); pub(crate) type BoxError = Box;