Merge pull request #807 from gwenn/clippy

Clippy
This commit is contained in:
gwenn 2020-10-04 07:58:13 +02:00 committed by GitHub
commit 4a54e118f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,7 +17,9 @@
//! [datetime](https://www.sqlite.org/lang_datefunc.html) functions. If you //! [datetime](https://www.sqlite.org/lang_datefunc.html) functions. If you
//! want different storage for datetimes, you can use a newtype. //! want different storage for datetimes, you can use a newtype.
//! //!
#![cfg_attr(feature = "time", doc = r##" #![cfg_attr(
feature = "time",
doc = r##"
For example, to store datetimes as `i64`s counting the number of seconds since For example, to store datetimes as `i64`s counting the number of seconds since
the Unix epoch: the Unix epoch:
@ -42,7 +44,8 @@ impl ToSql for DateTimeSql {
} }
``` ```
"##)] "##
)]
//! `ToSql` and `FromSql` are also implemented for `Option<T>` where `T` //! `ToSql` and `FromSql` are also implemented for `Option<T>` where `T`
//! implements `ToSql` or `FromSql` for the cases where you want to know if a //! implements `ToSql` or `FromSql` for the cases where you want to know if a
//! value was NULL (which gets translated to `None`). //! value was NULL (which gets translated to `None`).
@ -229,10 +232,7 @@ mod test {
#[allow(clippy::cognitive_complexity)] #[allow(clippy::cognitive_complexity)]
fn test_mismatched_types() { fn test_mismatched_types() {
fn is_invalid_column_type(err: Error) -> bool { fn is_invalid_column_type(err: Error) -> bool {
match err { matches!(err, Error::InvalidColumnType(..))
Error::InvalidColumnType(..) => true,
_ => false,
}
} }
let db = checked_memory_handle(); let db = checked_memory_handle();