Skip to content

Commit 87c321c

Browse files
committed
Do not expose Parser::into_comments
Since the parser's API is too widely open, users can easily break the binary search provided by `Comments::find`. One possibility could be to expose `Parser::into_comments` sorting the comments first, but have `Parser::parse_sql_with_comments` do wihtout. To be decided later.
1 parent 18bbbc5 commit 87c321c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/parser/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ impl<'a> Parser<'a> {
546546
}
547547

548548
/// Consumes this parser returning comments from the parsed token stream.
549-
pub fn into_comments(self) -> comments::Comments {
549+
fn into_comments(self) -> comments::Comments {
550550
let mut comments = comments::Comments::default();
551551
for t in self.tokens.into_iter() {
552552
match t.token {

0 commit comments

Comments
 (0)