Skip to content

Commit 49fe387

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 3db6259 commit 49fe387

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
@@ -545,7 +545,7 @@ impl<'a> Parser<'a> {
545545
}
546546

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

0 commit comments

Comments
 (0)