Skip to content

Commit b064905

Browse files
committed
fix: resolve remaining simple clippy warnings
- Remove unused mut from variable declaration - Remove unused lifetime parameter - Remove legacy numeric constant import - Simplify boolean expression using De Morgan's law
1 parent b1bcbc1 commit b064905

File tree

6 files changed

+6
-8
lines changed

6 files changed

+6
-8
lines changed

sqlx-core/src/postgres/connection/executor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ impl PgConnection {
160160
self.pending_ready_for_query_count += 1;
161161
}
162162

163-
async fn get_or_prepare<'a>(
163+
async fn get_or_prepare(
164164
&mut self,
165165
sql: &str,
166166
parameters: &[PgTypeInfo],

sqlx-core/src/postgres/message/parse.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use std::i16;
21

32
use crate::io::{BufMutExt, Encode};
43
use crate::postgres::io::PgBufMutExt;

sqlx-core/src/postgres/options/ssl_mode.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ use std::str::FromStr;
44
/// Options for controlling the level of protection provided for PostgreSQL SSL connections.
55
///
66
/// It is used by the [`ssl_mode`](super::PgConnectOptions::ssl_mode) method.
7-
#[derive(Debug, Clone, Copy)]
8-
#[derive(Default)]
7+
#[derive(Debug, Clone, Copy, Default)]
98
pub enum PgSslMode {
109
/// Only try a non-SSL connection.
1110
Disable,
@@ -30,7 +29,6 @@ pub enum PgSslMode {
3029
VerifyFull,
3130
}
3231

33-
3432
impl FromStr for PgSslMode {
3533
type Err = Error;
3634

sqlx-core/src/postgres/statement.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ impl ColumnIndex<PgStatement<'_>> for &'_ str {
5353
.metadata
5454
.column_names
5555
.get(*self)
56-
.ok_or_else(|| Error::ColumnNotFound((*self).into())).copied()
56+
.ok_or_else(|| Error::ColumnNotFound((*self).into()))
57+
.copied()
5758
}
5859
}
5960

sqlx-core/src/postgres/types/lquery.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ impl FromStr for PgLQueryVariant {
263263

264264
fn from_str(s: &str) -> Result<Self, Self::Err> {
265265
let mut label_length = s.len();
266-
let mut rev_iter = s.bytes().rev();
266+
let rev_iter = s.bytes().rev();
267267
let mut modifiers = PgLQueryVariantFlag::default();
268268

269269
for b in rev_iter {

sqlx-core/src/postgres/types/range.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ where
447447
}
448448

449449
count += 1;
450-
if !(element.is_empty() && !quoted) {
450+
if !element.is_empty() || quoted {
451451
let value = Some(T::decode(PgValueRef {
452452
type_info: T::type_info(),
453453
format: PgValueFormat::Text,

0 commit comments

Comments
 (0)