Skip to content

Commit a2a6e04

Browse files
committed
clippy
1 parent 57f5a71 commit a2a6e04

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/webserver/database/csv_import.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,16 @@ enum CopyCsvOption<'a> {
3838
impl<'a> CopyCsvOption<'a> {
3939
fn delimiter(&self) -> Option<char> {
4040
match self {
41-
CopyCsvOption::Legacy(CopyLegacyOption::Delimiter(c)) => Some(*c),
42-
CopyCsvOption::New(CopyOption::Delimiter(c)) => Some(*c),
41+
CopyCsvOption::Legacy(CopyLegacyOption::Delimiter(c))
42+
| CopyCsvOption::New(CopyOption::Delimiter(c)) => Some(*c),
4343
_ => None,
4444
}
4545
}
4646

4747
fn quote(&self) -> Option<char> {
4848
match self {
49-
CopyCsvOption::CopyLegacyCsvOption(CopyLegacyCsvOption::Quote(c)) => Some(*c),
50-
CopyCsvOption::New(CopyOption::Quote(c)) => Some(*c),
49+
CopyCsvOption::CopyLegacyCsvOption(CopyLegacyCsvOption::Quote(c))
50+
| CopyCsvOption::New(CopyOption::Quote(c)) => Some(*c),
5151
_ => None,
5252
}
5353
}
@@ -69,14 +69,14 @@ impl<'a> CopyCsvOption<'a> {
6969

7070
fn escape(&self) -> Option<char> {
7171
match self {
72-
CopyCsvOption::New(CopyOption::Escape(c)) => Some(*c),
73-
CopyCsvOption::CopyLegacyCsvOption(CopyLegacyCsvOption::Escape(c)) => Some(*c),
72+
CopyCsvOption::New(CopyOption::Escape(c))
73+
| CopyCsvOption::CopyLegacyCsvOption(CopyLegacyCsvOption::Escape(c)) => Some(*c),
7474
_ => None,
7575
}
7676
}
7777
}
7878

79-
pub fn extract_csv_import(stmt: &mut Statement) -> Option<CsvImport> {
79+
pub fn extract_csv_copy_statement(stmt: &mut Statement) -> Option<CsvImport> {
8080
if let Statement::Copy {
8181
source: CopySource::Table {
8282
table_name,

src/webserver/database/sql.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use super::csv_import::{extract_csv_import, CsvImport};
1+
use super::csv_import::{extract_csv_copy_statement, CsvImport};
22
use super::sql_pseudofunctions::{func_call_to_param, StmtParam};
33
use crate::file_cache::AsyncFromStrWithState;
44
use crate::utils::add_value_to_map;
@@ -103,7 +103,7 @@ fn parse_single_statement(parser: &mut Parser<'_>, db_kind: AnyKind) -> Option<P
103103
value: StmtWithParams { query, params },
104104
});
105105
}
106-
if let Some(csv_import) = extract_csv_import(&mut stmt) {
106+
if let Some(csv_import) = extract_csv_copy_statement(&mut stmt) {
107107
return Some(ParsedStatement::CsvImport(csv_import));
108108
}
109109
Some(ParsedStatement::StmtWithParams(StmtWithParams {

0 commit comments

Comments
 (0)