mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-27 09:24:04 +00:00
Fix for clippy 1.73 (#995)
This commit is contained in:
parent
c811e22605
commit
02f3d78a92
3 changed files with 10 additions and 6 deletions
|
@ -155,7 +155,7 @@ impl fmt::Display for Ident {
|
|||
let escaped = value::escape_quoted_string(&self.value, q);
|
||||
write!(f, "{q}{escaped}{q}")
|
||||
}
|
||||
Some(q) if q == '[' => write!(f, "[{}]", self.value),
|
||||
Some('[') => write!(f, "[{}]", self.value),
|
||||
None => f.write_str(&self.value),
|
||||
_ => panic!("unexpected quote style"),
|
||||
}
|
||||
|
|
|
@ -490,7 +490,7 @@ where
|
|||
///
|
||||
/// This demonstrates how to effectively replace an expression with another more complicated one
|
||||
/// that references the original. This example avoids unnecessary allocations by using the
|
||||
/// [`std::mem`](std::mem) family of functions.
|
||||
/// [`std::mem`] family of functions.
|
||||
///
|
||||
/// ```
|
||||
/// # use sqlparser::parser::Parser;
|
||||
|
|
|
@ -4701,7 +4701,11 @@ impl<'a> Parser<'a> {
|
|||
pub fn parse_literal_string(&mut self) -> Result<String, ParserError> {
|
||||
let next_token = self.next_token();
|
||||
match next_token.token {
|
||||
Token::Word(Word { value, keyword, .. }) if keyword == Keyword::NoKeyword => Ok(value),
|
||||
Token::Word(Word {
|
||||
value,
|
||||
keyword: Keyword::NoKeyword,
|
||||
..
|
||||
}) => Ok(value),
|
||||
Token::SingleQuotedString(s) => Ok(s),
|
||||
Token::DoubleQuotedString(s) => Ok(s),
|
||||
Token::EscapedStringLiteral(s) if dialect_of!(self is PostgreSqlDialect | GenericDialect) => {
|
||||
|
@ -5853,8 +5857,8 @@ impl<'a> Parser<'a> {
|
|||
self.expect_token(&Token::Colon)?;
|
||||
} else if self.parse_keyword(Keyword::ROLE) {
|
||||
let context_modifier = match modifier {
|
||||
Some(keyword) if keyword == Keyword::LOCAL => ContextModifier::Local,
|
||||
Some(keyword) if keyword == Keyword::SESSION => ContextModifier::Session,
|
||||
Some(Keyword::LOCAL) => ContextModifier::Local,
|
||||
Some(Keyword::SESSION) => ContextModifier::Session,
|
||||
_ => ContextModifier::None,
|
||||
};
|
||||
|
||||
|
@ -6897,7 +6901,7 @@ impl<'a> Parser<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Parse an [`WildcardAdditionalOptions`](WildcardAdditionalOptions) information for wildcard select items.
|
||||
/// Parse an [`WildcardAdditionalOptions`] information for wildcard select items.
|
||||
///
|
||||
/// If it is not possible to parse it, will return an option.
|
||||
pub fn parse_wildcard_additional_options(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue