mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-16 04:00:15 +00:00
Eliminate redundant string copy of Tokenizer (#343)
Signed-off-by: koushiro <koushiro.cqx@gmail.com>
This commit is contained in:
parent
77d90d3b85
commit
d8adb1708c
1 changed files with 5 additions and 5 deletions
|
@ -290,17 +290,17 @@ pub struct TokenizerError {
|
|||
/// SQL Tokenizer
|
||||
pub struct Tokenizer<'a> {
|
||||
dialect: &'a dyn Dialect,
|
||||
pub query: String,
|
||||
pub line: u64,
|
||||
pub col: u64,
|
||||
query: &'a str,
|
||||
line: u64,
|
||||
col: u64,
|
||||
}
|
||||
|
||||
impl<'a> Tokenizer<'a> {
|
||||
/// Create a new SQL tokenizer for the specified SQL statement
|
||||
pub fn new(dialect: &'a dyn Dialect, query: &str) -> Self {
|
||||
pub fn new(dialect: &'a dyn Dialect, query: &'a str) -> Self {
|
||||
Self {
|
||||
dialect,
|
||||
query: query.to_string(),
|
||||
query,
|
||||
line: 1,
|
||||
col: 1,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue