Merge pull request #425 from gwenn/clippy

Clippy
This commit is contained in:
gwenn 2018-11-01 10:32:00 +01:00 committed by GitHub
commit 31767cf776
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 8 deletions

View File

@ -1,3 +1,4 @@
#![feature(extern_crate_item_prelude)]
#![feature(test)] #![feature(test)]
extern crate test; extern crate test;

View File

@ -147,7 +147,7 @@ pub mod vtab;
// Number of cached prepared statements we'll hold on to. // Number of cached prepared statements we'll hold on to.
const STATEMENT_CACHE_DEFAULT_CAPACITY: usize = 16; const STATEMENT_CACHE_DEFAULT_CAPACITY: usize = 16;
/// To be used when your statement has no [parameter](https://sqlite.org/lang_expr.html#varparam). /// To be used when your statement has no [parameter](https://sqlite.org/lang_expr.html#varparam).
pub const NO_PARAMS: &'static [&'static ToSql] = &[]; pub const NO_PARAMS: &[&ToSql] = &[];
/// Old name for `Result`. `SqliteResult` is deprecated. /// Old name for `Result`. `SqliteResult` is deprecated.
#[deprecated(since = "0.6.0", note = "Use Result instead")] #[deprecated(since = "0.6.0", note = "Use Result instead")]

View File

@ -367,12 +367,7 @@ impl<'conn> Statement<'conn> {
P::Item: ToSql, P::Item: ToSql,
{ {
let mut rows = try!(self.query(params)); let mut rows = try!(self.query(params));
let exists = { let exists = rows.next().is_some();
match rows.next() {
Some(_) => true,
None => false,
}
};
Ok(exists) Ok(exists)
} }

View File

@ -467,7 +467,9 @@ impl<'a> Values<'a> {
Error::FromSqlConversionFailure(idx, value.data_type(), err) Error::FromSqlConversionFailure(idx, value.data_type(), err)
} }
FromSqlError::OutOfRange(i) => Error::IntegralValueOutOfRange(idx, i), FromSqlError::OutOfRange(i) => Error::IntegralValueOutOfRange(idx, i),
}) #[cfg(feature = "i128_blob")]
FromSqlError::InvalidI128Size(_) => Error::InvalidColumnType(idx, value.data_type()),
})
} }
// `sqlite3_value_type` returns `SQLITE_NULL` for pointer. // `sqlite3_value_type` returns `SQLITE_NULL` for pointer.