Skip to content

Commit eb5177d

Browse files
committed
fix: resolve more clippy warnings
- Remove reference patterns in query.rs match statements - Fix unneeded return statements in net/tls/mod.rs - Remove explicit deref in postgres/column.rs - Revert redundant closure fix that caused compilation error
1 parent 609db87 commit eb5177d

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

sqlx-core/src/net/tls/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ where
147147
{
148148
let raw = stream.into_inner().0;
149149
*self = MaybeTlsStream::Raw(raw);
150-
return Ok(());
150+
Ok(())
151151
}
152152

153153
#[cfg(feature = "_tls-native-tls")]
@@ -159,11 +159,11 @@ where
159159

160160
MaybeTlsStream::Raw(stream) => {
161161
*self = MaybeTlsStream::Raw(stream);
162-
return Ok(());
162+
Ok(())
163163
}
164164

165165
MaybeTlsStream::Upgrading => {
166-
return Err(Error::Io(io::ErrorKind::ConnectionAborted.into()));
166+
Err(Error::Io(io::ErrorKind::ConnectionAborted.into()))
167167
}
168168
}
169169
}

sqlx-core/src/postgres/column.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ impl Column for PgColumn {
2424
}
2525

2626
fn name(&self) -> &str {
27-
&*self.name
27+
&self.name
2828
}
2929

3030
fn type_info(&self) -> &PgTypeInfo {

sqlx-core/src/query.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ where
4444
#[inline]
4545
fn sql(&self) -> &'q str {
4646
match self.statement {
47-
Either::Right(ref statement) => statement.sql(),
47+
Either::Right(statement) => statement.sql(),
4848
Either::Left(sql) => sql,
4949
}
5050
}
5151

5252
fn statement(&self) -> Option<&<DB as HasStatement<'q>>::Statement> {
5353
match self.statement {
54-
Either::Right(ref statement) => Some(statement),
54+
Either::Right(statement) => Some(statement),
5555
Either::Left(_) => None,
5656
}
5757
}
@@ -293,7 +293,7 @@ where
293293
let mut f = self.mapper;
294294
Map {
295295
inner: self.inner,
296-
mapper: move |row| f(row).and_then(g),
296+
mapper: move |row| f(row).and_then(|o| g(o)),
297297
}
298298
}
299299

0 commit comments

Comments
 (0)