Skip to content

Commit 0602c66

Browse files
committed
Don't make string mod public, make a hidden _export module instead.
1 parent 1e270a9 commit 0602c66

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/lib.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ mod histbuf;
9797
mod indexmap;
9898
mod indexset;
9999
mod linear_map;
100-
pub mod string;
100+
mod string;
101101
mod vec;
102102

103103
#[cfg(feature = "serde")]
@@ -134,3 +134,10 @@ pub mod spsc;
134134
mod ufmt;
135135

136136
mod sealed;
137+
138+
/// Implementation details for macros.
139+
/// Do not use. Used for macros only. Not covered by semver guarantees.
140+
#[doc(hidden)]
141+
pub mod _export {
142+
pub use crate::string::format;
143+
}

src/string.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -637,11 +637,11 @@ macro_rules! format {
637637
// Without semicolon as separator to disambiguate between arms, Rust just
638638
// chooses the first so that the format string would land in $max.
639639
($max:expr; $($arg:tt)*) => {{
640-
let res = $crate::string::format::<$max>(core::format_args!($($arg)*));
640+
let res = $crate::_export::format::<$max>(core::format_args!($($arg)*));
641641
res
642642
}};
643643
($($arg:tt)*) => {{
644-
let res = $crate::string::format(core::format_args!($($arg)*));
644+
let res = $crate::_export::format(core::format_args!($($arg)*));
645645
res
646646
}};
647647
}

0 commit comments

Comments
 (0)