Skip to content

Commit

Permalink
suppress warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
pietroalbini committed Oct 26, 2024
1 parent 8c8e782 commit d8ee159
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
1 change: 1 addition & 0 deletions expandable-impl/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ pub enum Error<Span = proc_macro2::Span> {
got_nesting: Vec<RepetitionQuantifierKind>,
},

#[cfg_attr(not(test), expect(missing_docs))] // TODO: document
InvalidSeparator {
tree: TokenTree,
},
Expand Down
16 changes: 6 additions & 10 deletions expandable-impl/src/token_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ pub(crate) struct ParseCtxt {
}

impl ParseCtxt {
#[cfg_attr(not(test), expect(dead_code))] // TODO: use it
pub(crate) fn matcher() -> ParseCtxt {
let mode = ParseMode::Matcher;
ParseCtxt {
Expand All @@ -109,18 +110,11 @@ impl ParseCtxt {
}
}

#[cfg_attr(not(test), expect(dead_code))] // TODO: use it
pub(crate) fn turn_into_transcriber(&mut self) {
self.mode = ParseMode::Transcriber;
}

fn with_mode(mode: ParseMode) -> ParseCtxt {
ParseCtxt {
counter: 0,
mode,
metavariables: HashMap::new(),
}
}

fn id(&mut self) -> RepetitionId {
let id = RepetitionId(self.counter);
self.counter += 1;
Expand All @@ -130,12 +124,13 @@ impl ParseCtxt {
}

#[derive(Clone, Copy, PartialEq)]
enum ParseMode {
pub(crate) enum ParseMode {
Matcher,
Transcriber,
}

impl TokenTree {
#[cfg_attr(not(test), expect(dead_code))] // TODO: use it
pub(crate) fn from_generic(
ctx: &mut ParseCtxt,
tokens: GenericTokenStream,
Expand Down Expand Up @@ -386,7 +381,8 @@ impl TokenTree {
})
}

fn into_generic(stream: Vec<TokenTree>, mode: ParseMode) -> GenericTokenStream {
#[expect(dead_code)] // TODO: use it
pub(crate) fn into_generic(stream: Vec<TokenTree>, mode: ParseMode) -> GenericTokenStream {
stream
.into_iter()
.fold(GenericTokenStream::new(), |mut stream, tree| {
Expand Down

0 comments on commit d8ee159

Please sign in to comment.