From 794a3e65368efd7d9a13b2c10ede918381df8cf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20Buga?= Date: Sat, 22 Apr 2023 01:36:03 +0200 Subject: [PATCH] Hide the extension_group macro --- src/extensions/messages/extension_group_macro.rs | 6 ++++-- src/extensions/messages/mod.rs | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/extensions/messages/extension_group_macro.rs b/src/extensions/messages/extension_group_macro.rs index 49e8e23a..314b0235 100644 --- a/src/extensions/messages/extension_group_macro.rs +++ b/src/extensions/messages/extension_group_macro.rs @@ -1,5 +1,3 @@ -#[doc(hidden)] -#[macro_export] macro_rules! extension_group { (pub enum $name:ident$(<$lt:lifetime>)? { $($extension:ident($extension_data:ty)),+ @@ -91,3 +89,7 @@ macro_rules! extension_group { } }; } + +// This re-export makes it possible to omit #[macro_export] +// https://stackoverflow.com/a/67140319 +pub(crate) use extension_group; diff --git a/src/extensions/messages/mod.rs b/src/extensions/messages/mod.rs index 8dc18e2a..a08a9f3e 100644 --- a/src/extensions/messages/mod.rs +++ b/src/extensions/messages/mod.rs @@ -1,8 +1,7 @@ mod extension_group_macro; -use crate::{ - extension_group, - extensions::extension_data::{ +use crate::extensions::{ + extension_data::{ application_layer_protocol_negotiation::ApplicationLayerProtocolNegotiation, certificate_authorities::CertificateAuthorities, certificate_type::{ @@ -46,6 +45,7 @@ use crate::{ }, use_srtp::UseSrtp, }, + messages::extension_group_macro::extension_group, }; // Source: https://www.rfc-editor.org/rfc/rfc8446#section-4.2 table, rows marked with SH