From 0ac916b70b1f4f1dd5a3518a4aef0715ed27cff6 Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Wed, 3 Jan 2024 17:23:41 +0000 Subject: [PATCH 1/2] Make clippy fail on warnings --- .github/workflows/linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index d0db574..ab97813 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -27,7 +27,7 @@ jobs: - name: Check formatting run: cargo fmt -- --check - name: Clippy - run: cargo clippy + run: cargo clippy -- -D warnings - name: Build and test env: ODBC_SYS_STATIC_PATH: /usr/lib/x86_64-linux-gnu/ From 4d6a566ea7d4e4014da05060e62e89da654aa21b Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Wed, 3 Jan 2024 17:25:57 +0000 Subject: [PATCH 2/2] Fix clippy warnings --- src/odbc.rs | 4 ++-- src/pg.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/odbc.rs b/src/odbc.rs index d921278..66fc139 100644 --- a/src/odbc.rs +++ b/src/odbc.rs @@ -46,8 +46,8 @@ pub fn connect(opts: &Opts) -> std::result::Result>, const BATCH_SIZE: u32 = 100000; -fn execute_statement<'env>( - conn: &Connection<'env>, +fn execute_statement( + conn: &Connection, sql_query: &str, ) -> Result>, DbError> { let mut results: Vec> = Vec::new(); diff --git a/src/pg.rs b/src/pg.rs index fcb4887..f987c65 100644 --- a/src/pg.rs +++ b/src/pg.rs @@ -103,7 +103,7 @@ impl ServerCertVerifier for PassEverythingVerifier { pub fn rewrite_connection_string(opts: &mut Opts) -> std::result::Result<(), DbError> { let parsed = Url::parse(&opts.connection_string)?; // these are the ones accepted by tokio_postgres - if !vec!["postgres", "postgresql"].contains(&parsed.scheme()) { + if !["postgres", "postgresql"].contains(&parsed.scheme()) { warn!( "Non-standard scheme ({}), but we assume that it's a Postgres Connection URL", parsed.scheme()