diff --git a/.github/workflows/sqlx.yml b/.github/workflows/sqlx.yml index a147a0d267..5162d034b9 100644 --- a/.github/workflows/sqlx.yml +++ b/.github/workflows/sqlx.yml @@ -22,6 +22,10 @@ jobs: tls: [native-tls, rustls] steps: - uses: actions/checkout@v6 + - name: Install pinned Clippy toolchain + uses: dtolnay/rust-toolchain@ce678459e9fc7500d337468f904b95f1b5c10b5e + with: + components: clippy - uses: Swatinem/rust-cache@65012b490220f477f20ab979e35ae732e6de4e68 with: prefix-key: v1-sqlx diff --git a/sqlx-core/src/logger.rs b/sqlx-core/src/logger.rs index 6cfd80d215..ec52f04664 100644 --- a/sqlx-core/src/logger.rs +++ b/sqlx-core/src/logger.rs @@ -51,7 +51,7 @@ impl<'q> QueryLogger<'q> { let sql = if summary != self.sql { summary.push_str(" …"); - format!("\n\n{}\n", &self.sql) + format!("\n\n{}\n", self.sql) } else { String::new() }; @@ -125,7 +125,7 @@ impl<'q, O: Debug + Hash + Eq, R: Debug, P: Debug> QueryPlanLogger<'q, O, R, P> let sql = if summary != self.sql { summary.push_str(" …"); - format!("\n\n{}\n", &self.sql) + format!("\n\n{}\n", self.sql) } else { String::new() }; diff --git a/sqlx-core/src/mssql/connection/stream.rs b/sqlx-core/src/mssql/connection/stream.rs index 0911d4d235..8a35beae30 100644 --- a/sqlx-core/src/mssql/connection/stream.rs +++ b/sqlx-core/src/mssql/connection/stream.rs @@ -342,7 +342,7 @@ pub(crate) fn write_packets<'en, T: Encode<'en>>( ); } - packet_header.truncate(0); + packet_header.clear(); PacketHeader { r#type: ty, status: if is_last { diff --git a/sqlx-core/src/postgres/connection/sasl.rs b/sqlx-core/src/postgres/connection/sasl.rs index 6e6ee68339..665590d313 100644 --- a/sqlx-core/src/postgres/connection/sasl.rs +++ b/sqlx-core/src/postgres/connection/sasl.rs @@ -113,7 +113,7 @@ pub(crate) async fn authenticate( let client_final_message_wo_proof = format!( "{channel_binding},r={nonce}", channel_binding = channel_binding, - nonce = &cont.nonce + nonce = cont.nonce ); // AuthMessage := client-first-message-bare + "," + server-first-message + "," + client-final-message-without-proof diff --git a/sqlx-macros/src/query/output.rs b/sqlx-macros/src/query/output.rs index a08451ed87..4e1f0c6787 100644 --- a/sqlx-macros/src/query/output.rs +++ b/sqlx-macros/src/query/output.rs @@ -226,7 +226,7 @@ fn get_column_type(i: usize, column: &DB::Column) -> TokenStrea if let Some(feature_gate) = ::get_feature_gate(type_info) { format!( "optional feature `{feat}` required for type {ty} of {col}", - ty = &type_info, + ty = type_info, feat = feature_gate, col = DisplayColumn { idx: i, diff --git a/tests/postgres/types.rs b/tests/postgres/types.rs index 72914e0293..20f52fe426 100644 --- a/tests/postgres/types.rs +++ b/tests/postgres/types.rs @@ -69,7 +69,7 @@ test_type!(str<&str>(Postgres, )); test_type!(string(Postgres, - "'this is foo'" == format!("this is foo"), + "'this is foo'" == "this is foo".to_string(), )); test_type!(string_vec>(Postgres,