Skip to content

Commit c183c8f

Browse files
committed
Fix clippy
1 parent 8e5fb5f commit c183c8f

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

postgres-range/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,8 +428,8 @@ where
428428
match self.inner {
429429
Empty => false,
430430
Normal(ref lower, ref upper) => {
431-
lower.as_ref().map_or(true, |b| b.in_bounds(value))
432-
&& upper.as_ref().map_or(true, |b| b.in_bounds(value))
431+
lower.as_ref().is_none_or(|b| b.in_bounds(value))
432+
&& upper.as_ref().is_none_or(|b| b.in_bounds(value))
433433
}
434434
}
435435
}

postgres-types/src/chrono_04.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ fn base() -> NaiveDateTime {
1414
.unwrap()
1515
}
1616

17-
impl<'a> FromSql<'a> for NaiveDateTime {
17+
impl FromSql<'_> for NaiveDateTime {
1818
fn from_sql(_: &Type, raw: &[u8]) -> Result<NaiveDateTime, Box<dyn Error + Sync + Send>> {
1919
let t = types::timestamp_from_sql(raw)?;
2020
base()
@@ -39,7 +39,7 @@ impl ToSql for NaiveDateTime {
3939
to_sql_checked!();
4040
}
4141

42-
impl<'a> FromSql<'a> for DateTime<Utc> {
42+
impl FromSql<'_> for DateTime<Utc> {
4343
fn from_sql(type_: &Type, raw: &[u8]) -> Result<DateTime<Utc>, Box<dyn Error + Sync + Send>> {
4444
let naive = NaiveDateTime::from_sql(type_, raw)?;
4545
Ok(Utc.from_utc_datetime(&naive))
@@ -61,7 +61,7 @@ impl ToSql for DateTime<Utc> {
6161
to_sql_checked!();
6262
}
6363

64-
impl<'a> FromSql<'a> for DateTime<Local> {
64+
impl FromSql<'_> for DateTime<Local> {
6565
fn from_sql(type_: &Type, raw: &[u8]) -> Result<DateTime<Local>, Box<dyn Error + Sync + Send>> {
6666
let utc = DateTime::<Utc>::from_sql(type_, raw)?;
6767
Ok(utc.with_timezone(&Local))
@@ -83,7 +83,7 @@ impl ToSql for DateTime<Local> {
8383
to_sql_checked!();
8484
}
8585

86-
impl<'a> FromSql<'a> for DateTime<FixedOffset> {
86+
impl FromSql<'_> for DateTime<FixedOffset> {
8787
fn from_sql(
8888
type_: &Type,
8989
raw: &[u8],
@@ -108,7 +108,7 @@ impl ToSql for DateTime<FixedOffset> {
108108
to_sql_checked!();
109109
}
110110

111-
impl<'a> FromSql<'a> for NaiveDate {
111+
impl FromSql<'_> for NaiveDate {
112112
fn from_sql(_: &Type, raw: &[u8]) -> Result<NaiveDate, Box<dyn Error + Sync + Send>> {
113113
let jd = types::date_from_sql(raw)?;
114114
base()
@@ -135,7 +135,7 @@ impl ToSql for NaiveDate {
135135
to_sql_checked!();
136136
}
137137

138-
impl<'a> FromSql<'a> for NaiveTime {
138+
impl FromSql<'_> for NaiveTime {
139139
fn from_sql(_: &Type, raw: &[u8]) -> Result<NaiveTime, Box<dyn Error + Sync + Send>> {
140140
let usec = types::time_from_sql(raw)?;
141141
Ok(NaiveTime::from_hms_opt(0, 0, 0).unwrap() + Duration::microseconds(usec))

postgres/src/transaction.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub struct Transaction<'a> {
1414
transaction: Option<tokio_postgres::Transaction<'a>>,
1515
}
1616

17-
impl<'a> fmt::Debug for Transaction<'a> {
17+
impl fmt::Debug for Transaction<'_> {
1818
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1919
fmt::Debug::fmt(&self.transaction, f)
2020
}

tokio-postgres/src/transaction.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pub struct Transaction<'a> {
3030
done: bool,
3131
}
3232

33-
impl<'a> fmt::Debug for Transaction<'a> {
33+
impl fmt::Debug for Transaction<'_> {
3434
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3535
f.debug_struct("Transaction")
3636
.field("savepoint", &self.savepoint)
@@ -444,7 +444,7 @@ impl<'a> Transaction<'a> {
444444
}
445445
}
446446

447-
impl<'a> Deref for Transaction<'a> {
447+
impl Deref for Transaction<'_> {
448448
type Target = Client;
449449

450450
fn deref(&self) -> &Self::Target {

0 commit comments

Comments
 (0)