Skip to content

Commit 531cf7a

Browse files
committed
fix: lots of new Clippy warnings
1 parent 901afd8 commit 531cf7a

File tree

26 files changed

+55
-63
lines changed

26 files changed

+55
-63
lines changed

benches/sqlite/describe.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use criterion::Criterion;
33
use criterion::{criterion_group, criterion_main};
44

55
use sqlx::sqlite::{Sqlite, SqliteConnection};
6-
use sqlx::{Connection, Executor};
6+
use sqlx::Executor;
77
use sqlx_test::new;
88

99
// Here we have an async function to benchmark

sqlx-macros-core/src/common.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ pub(crate) fn resolve_path(path: impl AsRef<Path>, err_span: Span) -> syn::Resul
1515
// requires `proc_macro::SourceFile::path()` to be stable
1616
// https://github.com/rust-lang/rust/issues/54725
1717
if path.is_relative()
18-
&& !path
18+
&& path
1919
.parent()
20-
.map_or(false, |parent| !parent.as_os_str().is_empty())
20+
.is_none_or(|parent| parent.as_os_str().is_empty())
2121
{
2222
return Err(syn::Error::new(
2323
err_span,

sqlx-macros-core/src/test_attr.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -246,13 +246,9 @@ fn parse_args(attr_args: AttributeArgs) -> syn::Result<Args> {
246246

247247
fn recurse_lit_lookup(expr: Expr) -> Option<Lit> {
248248
match expr {
249-
Expr::Lit(syn::ExprLit { lit, .. }) => {
250-
return Some(lit);
251-
}
252-
Expr::Group(syn::ExprGroup { expr, .. }) => {
253-
return recurse_lit_lookup(*expr);
254-
}
255-
_ => return None,
249+
Expr::Lit(syn::ExprLit { lit, .. }) => Some(lit),
250+
Expr::Group(syn::ExprGroup { expr, .. }) => recurse_lit_lookup(*expr),
251+
_ => None,
256252
}
257253
}
258254

sqlx-mysql/src/connection/establish.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ impl<'a> DoHandshake<'a> {
186186
}
187187
}
188188

189-
impl<'a> WithSocket for DoHandshake<'a> {
189+
impl WithSocket for DoHandshake<'_> {
190190
type Output = Result<MySqlStream, Error>;
191191

192192
async fn with_socket<S: Socket>(self, socket: S) -> Self::Output {

sqlx-mysql/src/connection/executor.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use futures_util::TryStreamExt;
2525
use std::{borrow::Cow, pin::pin, sync::Arc};
2626

2727
impl MySqlConnection {
28-
async fn prepare_statement<'c>(
28+
async fn prepare_statement(
2929
&mut self,
3030
sql: &str,
3131
) -> Result<(u32, MySqlStatementMetadata), Error> {
@@ -72,7 +72,7 @@ impl MySqlConnection {
7272
Ok((id, metadata))
7373
}
7474

75-
async fn get_or_prepare_statement<'c>(
75+
async fn get_or_prepare_statement(
7676
&mut self,
7777
sql: &str,
7878
) -> Result<(u32, MySqlStatementMetadata), Error> {

sqlx-mysql/src/protocol/statement/execute.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub struct Execute<'q> {
1111
pub arguments: &'q MySqlArguments,
1212
}
1313

14-
impl<'q> ProtocolEncode<'_, Capabilities> for Execute<'q> {
14+
impl ProtocolEncode<'_, Capabilities> for Execute<'_> {
1515
fn encode_with(&self, buf: &mut Vec<u8>, _: Capabilities) -> Result<(), crate::Error> {
1616
buf.push(0x17); // COM_STMT_EXECUTE
1717
buf.extend(&self.statement.to_le_bytes());

sqlx-mysql/src/types/text.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ impl<T> Type<MySql> for Text<T> {
1616
}
1717
}
1818

19-
impl<'q, T> Encode<'q, MySql> for Text<T>
19+
impl<T> Encode<'_, MySql> for Text<T>
2020
where
2121
T: Display,
2222
{

sqlx-postgres/src/types/cube.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ impl<'r> Decode<'r, Postgres> for PgCube {
7171
}
7272
}
7373

74-
impl<'q> Encode<'q, Postgres> for PgCube {
74+
impl Encode<'_, Postgres> for PgCube {
7575
fn produces(&self) -> Option<PgTypeInfo> {
7676
Some(PgTypeInfo::with_name("cube"))
7777
}

sqlx-postgres/src/types/geometry/box.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ impl<'r> Decode<'r, Postgres> for PgBox {
5656
}
5757
}
5858

59-
impl<'q> Encode<'q, Postgres> for PgBox {
59+
impl Encode<'_, Postgres> for PgBox {
6060
fn produces(&self) -> Option<PgTypeInfo> {
6161
Some(PgTypeInfo::with_name("box"))
6262
}

sqlx-postgres/src/types/geometry/circle.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ impl<'r> Decode<'r, Postgres> for PgCircle {
5454
}
5555
}
5656

57-
impl<'q> Encode<'q, Postgres> for PgCircle {
57+
impl Encode<'_, Postgres> for PgCircle {
5858
fn produces(&self) -> Option<PgTypeInfo> {
5959
Some(PgTypeInfo::with_name("circle"))
6060
}

0 commit comments

Comments
 (0)