Fix clippy lint on rust 1.86 (#1796)

This commit is contained in:
Ifeanyi Ubah 2025-04-04 12:34:18 +02:00 committed by GitHub
parent 7efa686d78
commit a847e44105
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 21 additions and 23 deletions

View file

@ -868,7 +868,7 @@ impl fmt::Display for AlterColumnOperation {
AlterColumnOperation::SetDefault { value } => { AlterColumnOperation::SetDefault { value } => {
write!(f, "SET DEFAULT {value}") write!(f, "SET DEFAULT {value}")
} }
AlterColumnOperation::DropDefault {} => { AlterColumnOperation::DropDefault => {
write!(f, "DROP DEFAULT") write!(f, "DROP DEFAULT")
} }
AlterColumnOperation::SetDataType { data_type, using } => { AlterColumnOperation::SetDataType { data_type, using } => {

View file

@ -7617,7 +7617,7 @@ impl fmt::Display for CopyTarget {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
use CopyTarget::*; use CopyTarget::*;
match self { match self {
Stdin { .. } => write!(f, "STDIN"), Stdin => write!(f, "STDIN"),
Stdout => write!(f, "STDOUT"), Stdout => write!(f, "STDOUT"),
File { filename } => write!(f, "'{}'", value::escape_single_quote_string(filename)), File { filename } => write!(f, "'{}'", value::escape_single_quote_string(filename)),
Program { command } => write!( Program { command } => write!(

View file

@ -1038,14 +1038,13 @@ fn parse_session_options(
} }
} }
} }
options if options.is_empty() {
.is_empty()
.then(|| {
Err(ParserError::ParserError( Err(ParserError::ParserError(
"expected at least one option".to_string(), "expected at least one option".to_string(),
)) ))
}) } else {
.unwrap_or(Ok(options)) Ok(options)
}
} }
/// Parses options provided within parentheses like: /// Parses options provided within parentheses like:

View file

@ -14091,8 +14091,7 @@ fn test_table_sample() {
#[test] #[test]
fn overflow() { fn overflow() {
let expr = std::iter::repeat("1") let expr = std::iter::repeat_n("1", 1000)
.take(1000)
.collect::<Vec<_>>() .collect::<Vec<_>>()
.join(" + "); .join(" + ");
let sql = format!("SELECT {}", expr); let sql = format!("SELECT {}", expr);