mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-09-01 11:47:20 +00:00
Accept &str in Parse::parse_sql
(#182)
It is more generic to accept a `&str` than a `String` in an API, and avoids having to convert a string to a `String` when not needed, avoiding a copy.
This commit is contained in:
parent
b4699bd4a7
commit
d32df527e6
6 changed files with 8 additions and 8 deletions
|
@ -58,9 +58,9 @@ impl TestedDialects {
|
|||
}
|
||||
|
||||
pub fn parse_sql_statements(&self, sql: &str) -> Result<Vec<Statement>, ParserError> {
|
||||
self.one_of_identical_results(|dialect| Parser::parse_sql(dialect, sql.to_string()))
|
||||
self.one_of_identical_results(|dialect| Parser::parse_sql(dialect, &sql))
|
||||
// To fail the `ensure_multiple_dialects_are_tested` test:
|
||||
// Parser::parse_sql(&**self.dialects.first().unwrap(), sql.to_string())
|
||||
// Parser::parse_sql(&**self.dialects.first().unwrap(), sql)
|
||||
}
|
||||
|
||||
/// Ensures that `sql` parses as a single statement, optionally checking
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue