-
-
Notifications
You must be signed in to change notification settings - Fork 520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor/fix clippy errors #2056
Changes from 15 commits
2bb46ed
0536427
26089f2
350fa86
9b80ac9
1620f33
86d6170
fc48065
ae017dc
b93c911
98b6f24
1b3cc3e
b04fdf8
6dc6748
8916c28
889d250
138b9dc
e4f4a12
09f845a
20dc881
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
allow-unwrap-in-tests = true | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,7 @@ impl std::fmt::Debug for SqlxMySqlPoolConnection { | |
|
||
impl SqlxMySqlConnector { | ||
/// Check if the URI provided corresponds to `mysql://` for a MySQL database | ||
#[cfg(feature = "mock")] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is what confuses me, this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that is because the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove feature flag and I put |
||
pub fn accepts(string: &str) -> bool { | ||
string.starts_with("mysql://") && string.parse::<MySqlConnectOptions>().is_ok() | ||
} | ||
|
@@ -65,16 +66,6 @@ impl SqlxMySqlConnector { | |
} | ||
} | ||
|
||
impl SqlxMySqlConnector { | ||
/// Instantiate a sqlx pool connection to a [DatabaseConnection] | ||
pub fn from_sqlx_mysql_pool(pool: MySqlPool) -> DatabaseConnection { | ||
DatabaseConnection::SqlxMySqlPoolConnection(SqlxMySqlPoolConnection { | ||
pool, | ||
metric_callback: None, | ||
}) | ||
} | ||
} | ||
|
||
impl SqlxMySqlPoolConnection { | ||
/// Execute a [Statement] on a MySQL backend | ||
#[instrument(level = "trace")] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -345,7 +345,6 @@ pub mod tests_cfg; | |
mod util; | ||
|
||
pub use database::*; | ||
pub use driver::*; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of removing this line, I think we should add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed I will add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have added |
||
pub use entity::*; | ||
pub use error::*; | ||
pub use executor::*; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ use crate::{ | |
ColumnTrait, EntityTrait, IdenStatic, Iterable, QueryTrait, Select, SelectTwo, SelectTwoMany, | ||
}; | ||
use core::marker::PhantomData; | ||
pub use sea_query::JoinType; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can confirm this is already exported in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, it is not exported so I have reverted this change. e4f4a12 |
||
use sea_query::{Alias, ColumnRef, Iden, Order, SeaRc, SelectExpr, SelectStatement, SimpleExpr}; | ||
|
||
macro_rules! select_def { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,6 @@ pub use combine::{SelectA, SelectB}; | |
pub use delete::*; | ||
pub use helper::*; | ||
pub use insert::*; | ||
pub use join::*; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The file contains only impl, so nothing to export There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In that case, do we need to keep |
||
#[cfg(feature = "with-json")] | ||
pub use json::*; | ||
pub use loader::*; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added this file to configure clippy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be a
#![allow(clippy::unwrap_used, clippy::expect_used)]
directive in test files would be better?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can do that. It might be better because clippy config file like
clippy.toml
is unstable.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
889d250