From 05a8424bd85659c2ee45056489df253b8bef892d Mon Sep 17 00:00:00 2001 From: Dylan Anthony Date: Tue, 30 Jul 2024 10:47:25 -0600 Subject: [PATCH] Simplify `register_plugin!` --- apollo-router/src/plugin/mod.rs | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/apollo-router/src/plugin/mod.rs b/apollo-router/src/plugin/mod.rs index 9fca1028e2..46dfbb1539 100644 --- a/apollo-router/src/plugin/mod.rs +++ b/apollo-router/src/plugin/mod.rs @@ -793,21 +793,7 @@ macro_rules! register_plugin { }; }; - ($group: literal, $name: literal, $plugin_type: ident) => { - // Artificial scope to avoid naming collisions - const _: () = { - use $crate::_private::once_cell::sync::Lazy; - use $crate::_private::PluginFactory; - use $crate::_private::PLUGINS; - - #[$crate::_private::linkme::distributed_slice(PLUGINS)] - #[linkme(crate = $crate::_private::linkme)] - static REGISTER_PLUGIN: Lazy = - Lazy::new(|| $crate::plugin::PluginFactory::new::<$plugin_type>($group, $name)); - }; - }; - - ($group: literal, $name: ident, $plugin_type: ident) => { + ($group: literal, $name: expr, $plugin_type: ident) => { // Artificial scope to avoid naming collisions const _: () = { use $crate::_private::once_cell::sync::Lazy;