Skip to content

Commit

Permalink
Do not export tracing/debug functions and macros (for now)
Browse files Browse the repository at this point in the history
  • Loading branch information
chifflier committed Apr 9, 2024
1 parent 1b95d2e commit 007ffbd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/asn1_types/sequence/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use alloc::vec::Vec;
use core::convert::TryFrom;
use core::fmt::Debug;

use self::debug::{trace, trace_generic};
use self::debug::{macros::debug_eprintln, trace, trace_generic};

// // XXX this compiles but requires bound TryFrom :/
// impl<'a, 'b, T> TryFrom<&'b Any<'a>> for Vec<T>
Expand Down
13 changes: 9 additions & 4 deletions src/debug.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::ParseResult;

#[macro_export]
macro_rules! debug_eprintln {
pub(crate) mod macros {
macro_rules! debug_eprintln {
($msg: expr, $( $args:expr ),* ) => {
#[cfg(feature = "debug")]
{
Expand All @@ -12,8 +12,7 @@ macro_rules! debug_eprintln {
};
}

#[macro_export]
macro_rules! trace_eprintln {
macro_rules! trace_eprintln {
($msg: expr, $( $args:expr ),* ) => {
#[cfg(feature = "trace")]
{
Expand All @@ -24,6 +23,12 @@ macro_rules! trace_eprintln {
};
}

pub(crate) use debug_eprintln;
pub(crate) use trace_eprintln;
}

use macros::*;

#[cfg(feature = "debug")]
fn eprintln_hex_dump(bytes: &[u8], max_len: usize) {
use core::cmp::min;
Expand Down

0 comments on commit 007ffbd

Please sign in to comment.