Skip to content

Commit 3c292f7

Browse files
committed
Move parse_quote private internals to __private module
1 parent 9b6fa52 commit 3c292f7

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

src/export.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ pub use crate::group::{parse_braces, parse_brackets, parse_parens};
1919

2020
pub use crate::span::IntoSpans;
2121

22+
#[cfg(all(feature = "parsing", feature = "printing"))]
23+
pub use crate::parse_quote::parse as parse_quote;
24+
2225
#[cfg(feature = "parsing")]
2326
pub use crate::token::parsing::{peek_punct, punct as parse_punct};
2427

src/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -429,10 +429,8 @@ pub mod parse;
429429
#[doc(hidden)]
430430
pub mod parse_macro_input;
431431

432-
// Not public API except the `parse_quote!` macro.
433432
#[cfg(all(feature = "parsing", feature = "printing"))]
434-
#[doc(hidden)]
435-
pub mod parse_quote;
433+
mod parse_quote;
436434

437435
#[cfg(feature = "full")]
438436
mod pat;

src/parse_quote.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
#[macro_export]
6969
macro_rules! parse_quote {
7070
($($tt:tt)*) => {
71-
$crate::parse_quote::parse($crate::__private::quote::quote!($($tt)*))
71+
$crate::__private::parse_quote($crate::__private::quote::quote!($($tt)*))
7272
};
7373
}
7474

@@ -100,7 +100,7 @@ macro_rules! parse_quote {
100100
#[macro_export]
101101
macro_rules! parse_quote_spanned {
102102
($span:expr=> $($tt:tt)*) => {
103-
$crate::parse_quote::parse($crate::__private::quote::quote_spanned!($span=> $($tt)*))
103+
$crate::__private::parse_quote($crate::__private::quote::quote_spanned!($span=> $($tt)*))
104104
};
105105
}
106106

@@ -120,8 +120,6 @@ pub fn parse<T: ParseQuote>(token_stream: TokenStream) -> T {
120120
}
121121
}
122122

123-
// Not public API.
124-
#[doc(hidden)]
125123
pub trait ParseQuote: Sized {
126124
fn parse(input: ParseStream) -> Result<Self>;
127125
}

0 commit comments

Comments
 (0)