1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-05-19 16:58:14 +00:00

Update scope macro code to work with current HttpServiceFactory

This commit is contained in:
Jon Lim 2023-09-10 14:15:41 -07:00
parent ad90bc926d
commit ac82b56ad7
2 changed files with 3 additions and 2 deletions

View file

@ -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<P: 'static> actix_web::dev::HttpServiceFactory<P> for {} {{", self.name)?;
writeln!(f, " fn register(self, config: &mut actix_web::dev::ServiceConfig<P>) {{")?;
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() {

View file

@ -143,5 +143,6 @@ codegen_reexport!(delete);
codegen_reexport!(trace);
codegen_reexport!(connect);
codegen_reexport!(options);
codegen_reexport!(scope);
pub(crate) type BoxError = Box<dyn std::error::Error>;