style(core): clippy

This commit is contained in:
Ryan Leckey 2021-02-18 23:59:11 -08:00
parent 3078957a66
commit 9413146bb7
No known key found for this signature in database
GPG Key ID: F8AA68C235AB08C9
5 changed files with 16 additions and 13 deletions

View File

@ -7,6 +7,7 @@ where
type Options: ConnectOptions;
#[cfg(feature = "async")]
#[must_use]
fn connect(url: &str) -> futures_util::future::BoxFuture<'_, crate::Result<Self>>
where
Self: Sized,
@ -17,6 +18,7 @@ where
}
#[cfg(feature = "async")]
#[must_use]
fn connect_with(
options: &Self::Options,
) -> futures_util::future::BoxFuture<'_, crate::Result<Self>>

View File

@ -79,7 +79,7 @@ impl<'q, 'a, Db: Database> Execute<'q, 'a, Db> for (&'q str, &'a Arguments<'a, D
}
fn arguments(&self) -> Option<&'_ Arguments<'a, Db>> {
Some(&self.1)
Some(self.1)
}
}
@ -89,7 +89,7 @@ impl<'q, 'a, Db: Database> Execute<'q, 'a, Db> for (&'q String, &'a Arguments<'a
}
fn arguments(&self) -> Option<&'_ Arguments<'a, Db>> {
Some(&self.1)
Some(self.1)
}
}
impl<'a, Db: Database> Execute<'_, 'a, Db> for (String, &'a Arguments<'a, Db>) {
@ -98,6 +98,6 @@ impl<'a, Db: Database> Execute<'_, 'a, Db> for (String, &'a Arguments<'a, Db>) {
}
fn arguments(&self) -> Option<&'_ Arguments<'a, Db>> {
Some(&self.1)
Some(self.1)
}
}

View File

@ -1,7 +1,7 @@
#[cfg(feature = "async")]
use futures_util::future::{self, BoxFuture, FutureExt, TryFutureExt};
use crate::{Database, Execute, Runtime};
use crate::{Database, Runtime};
/// Describes a type that can execute SQL queries on a self-provided database connection.
///
@ -24,7 +24,7 @@ pub trait Executor<Rt: Runtime> {
) -> BoxFuture<'x, crate::Result<<Self::Database as Database>::QueryResult>>
where
Rt: crate::Async,
E: 'x + Execute<'q, 'a, Self::Database>,
E: 'x + crate::Execute<'q, 'a, Self::Database>,
'e: 'x,
'q: 'x,
'a: 'x;
@ -36,7 +36,7 @@ pub trait Executor<Rt: Runtime> {
) -> BoxFuture<'x, crate::Result<Vec<<Self::Database as Database>::Row>>>
where
Rt: crate::Async,
E: 'x + Execute<'q, 'a, Self::Database>,
E: 'x + crate::Execute<'q, 'a, Self::Database>,
'e: 'x,
'q: 'x,
'a: 'x;
@ -48,7 +48,7 @@ pub trait Executor<Rt: Runtime> {
) -> BoxFuture<'x, crate::Result<Option<<Self::Database as Database>::Row>>>
where
Rt: crate::Async,
E: 'x + Execute<'q, 'a, Self::Database>,
E: 'x + crate::Execute<'q, 'a, Self::Database>,
'e: 'x,
'q: 'x,
'a: 'x;
@ -60,7 +60,7 @@ pub trait Executor<Rt: Runtime> {
) -> BoxFuture<'x, crate::Result<<Self::Database as Database>::Row>>
where
Rt: crate::Async,
E: 'x + Execute<'q, 'a, Self::Database>,
E: 'x + crate::Execute<'q, 'a, Self::Database>,
'e: 'x,
'q: 'x,
'a: 'x,
@ -84,7 +84,7 @@ impl<Rt: Runtime, X: Executor<Rt>> Executor<Rt> for &'_ mut X {
) -> BoxFuture<'x, crate::Result<<Self::Database as Database>::QueryResult>>
where
Rt: crate::Async,
E: 'x + Execute<'q, 'a, Self::Database>,
E: 'x + crate::Execute<'q, 'a, Self::Database>,
'e: 'x,
'q: 'x,
'a: 'x,
@ -99,7 +99,7 @@ impl<Rt: Runtime, X: Executor<Rt>> Executor<Rt> for &'_ mut X {
) -> BoxFuture<'x, crate::Result<Vec<<Self::Database as Database>::Row>>>
where
Rt: crate::Async,
E: 'x + Execute<'q, 'a, Self::Database>,
E: 'x + crate::Execute<'q, 'a, Self::Database>,
'e: 'x,
'q: 'x,
'a: 'x,
@ -114,7 +114,7 @@ impl<Rt: Runtime, X: Executor<Rt>> Executor<Rt> for &'_ mut X {
) -> BoxFuture<'x, crate::Result<Option<<Self::Database as Database>::Row>>>
where
Rt: crate::Async,
E: 'x + Execute<'q, 'a, Self::Database>,
E: 'x + crate::Execute<'q, 'a, Self::Database>,
'e: 'x,
'q: 'x,
'a: 'x,

View File

@ -16,7 +16,8 @@
#![warn(clippy::use_self)]
#![warn(clippy::useless_let_if_seq)]
#![allow(clippy::doc_markdown)]
#![allow(clippy::clippy::missing_errors_doc)]
#![allow(clippy::missing_errors_doc)]
#![allow(clippy::missing_panics_doc)]
mod acquire;
pub mod arguments;

View File

@ -36,7 +36,7 @@ pub trait Row: 'static + Send + Sync {
T: Decode<'r, Self::Database>;
/// Returns the raw representation of the value at the index.
// noinspection RsNeedlessLifetimes
#[allow(clippy::needless_lifetimes)]
fn try_get_raw<'r>(
&'r self,
index: usize,