Skip to content

Commit

Permalink
Fix clippy lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Napetti committed Aug 26, 2021
1 parent 344659f commit 8f0f8a1
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/executor/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,21 +86,21 @@ macro_rules! try_getable_all {
use sqlx::Row;
row.try_get::<Option<$type>, _>(column.as_str())
.map_err(|e| TryGetError::DbErr(crate::sqlx_error_to_query_err(e)))
.and_then(|opt| opt.ok_or_else(|| TryGetError::Null))
.and_then(|opt| opt.ok_or(TryGetError::Null))
}
#[cfg(feature = "sqlx-postgres")]
QueryResultRow::SqlxPostgres(row) => {
use sqlx::Row;
row.try_get::<Option<$type>, _>(column.as_str())
.map_err(|e| TryGetError::DbErr(crate::sqlx_error_to_query_err(e)))
.and_then(|opt| opt.ok_or_else(|| TryGetError::Null))
.and_then(|opt| opt.ok_or(TryGetError::Null))
}
#[cfg(feature = "sqlx-sqlite")]
QueryResultRow::SqlxSqlite(row) => {
use sqlx::Row;
row.try_get::<Option<$type>, _>(column.as_str())
.map_err(|e| TryGetError::DbErr(crate::sqlx_error_to_query_err(e)))
.and_then(|opt| opt.ok_or_else(|| TryGetError::Null))
.and_then(|opt| opt.ok_or(TryGetError::Null))
}
#[cfg(feature = "mock")]
QueryResultRow::Mock(row) => row.try_get(column.as_str()).map_err(|e| {
Expand All @@ -124,7 +124,7 @@ macro_rules! try_getable_unsigned {
use sqlx::Row;
row.try_get::<Option<$type>, _>(column.as_str())
.map_err(|e| TryGetError::DbErr(crate::sqlx_error_to_query_err(e)))
.and_then(|opt| opt.ok_or_else(|| TryGetError::Null))
.and_then(|opt| opt.ok_or(TryGetError::Null))
}
#[cfg(feature = "sqlx-postgres")]
QueryResultRow::SqlxPostgres(_) => {
Expand All @@ -135,7 +135,7 @@ macro_rules! try_getable_unsigned {
use sqlx::Row;
row.try_get::<Option<$type>, _>(column.as_str())
.map_err(|e| TryGetError::DbErr(crate::sqlx_error_to_query_err(e)))
.and_then(|opt| opt.ok_or_else(|| TryGetError::Null))
.and_then(|opt| opt.ok_or(TryGetError::Null))
}
#[cfg(feature = "mock")]
QueryResultRow::Mock(row) => row.try_get(column.as_str()).map_err(|e| {
Expand All @@ -159,7 +159,7 @@ macro_rules! try_getable_mysql {
use sqlx::Row;
row.try_get::<Option<$type>, _>(column.as_str())
.map_err(|e| TryGetError::DbErr(crate::sqlx_error_to_query_err(e)))
.and_then(|opt| opt.ok_or_else(|| TryGetError::Null))
.and_then(|opt| opt.ok_or(TryGetError::Null))
}
#[cfg(feature = "sqlx-postgres")]
QueryResultRow::SqlxPostgres(_) => {
Expand Down Expand Up @@ -195,7 +195,7 @@ macro_rules! try_getable_postgres {
use sqlx::Row;
row.try_get::<Option<$type>, _>(column.as_str())
.map_err(|e| TryGetError::DbErr(crate::sqlx_error_to_query_err(e)))
.and_then(|opt| opt.ok_or_else(|| TryGetError::Null))
.and_then(|opt| opt.ok_or(TryGetError::Null))
}
#[cfg(feature = "sqlx-sqlite")]
QueryResultRow::SqlxSqlite(_) => {
Expand Down Expand Up @@ -247,14 +247,14 @@ impl TryGetable for Decimal {
use sqlx::Row;
row.try_get::<Option<Decimal>, _>(column.as_str())
.map_err(|e| TryGetError::DbErr(crate::sqlx_error_to_query_err(e)))
.and_then(|opt| opt.ok_or_else(|| TryGetError::Null))
.and_then(|opt| opt.ok_or(TryGetError::Null))
}
#[cfg(feature = "sqlx-postgres")]
QueryResultRow::SqlxPostgres(row) => {
use sqlx::Row;
row.try_get::<Option<Decimal>, _>(column.as_str())
.map_err(|e| TryGetError::DbErr(crate::sqlx_error_to_query_err(e)))
.and_then(|opt| opt.ok_or_else(|| TryGetError::Null))
.and_then(|opt| opt.ok_or(TryGetError::Null))
}
#[cfg(feature = "sqlx-sqlite")]
QueryResultRow::SqlxSqlite(row) => {
Expand Down

0 comments on commit 8f0f8a1

Please sign in to comment.