mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-01 15:34:19 +01:00
do not use Name::new
This commit is contained in:
@@ -745,7 +745,7 @@ impl ToTokens for Expr {
|
||||
Self::Collate(expr, collation) => {
|
||||
expr.to_tokens(s, context)?;
|
||||
s.append(TK_COLLATE, None)?;
|
||||
double_quote(collation.as_str(), s)
|
||||
s.append(TK_ID, Some(&collation.as_quoted()))
|
||||
}
|
||||
Self::DoublyQualified(db_name, tbl_name, col_name) => {
|
||||
db_name.to_tokens(s, context)?;
|
||||
@@ -1370,7 +1370,7 @@ impl ToTokens for Name {
|
||||
s: &mut S,
|
||||
_: &C,
|
||||
) -> Result<(), S::Error> {
|
||||
double_quote(self.as_literal(), s)
|
||||
s.append(TK_ID, Some(&self.as_quoted()))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2460,11 +2460,3 @@ where
|
||||
{
|
||||
s.comma(items, context)
|
||||
}
|
||||
|
||||
// TK_ID: [...] / `...` / "..." / some keywords / non keywords
|
||||
fn double_quote<S: TokenStream + ?Sized>(name: &str, s: &mut S) -> Result<(), S::Error> {
|
||||
if name.is_empty() {
|
||||
return s.append(TK_ID, Some("\"\""));
|
||||
}
|
||||
s.append(TK_ID, Some(name))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user