mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-26 19:41:37 +08:00
Update clippy version and address new warnings
This commit is contained in:
parent
aea2f876d5
commit
2bd54578f5
@ -23,7 +23,7 @@ trace = []
|
||||
time = "~0.1.0"
|
||||
bitflags = "~0.1"
|
||||
libc = "~0.2"
|
||||
clippy = {version = "~0.0.41", optional = true}
|
||||
clippy = {version = "~0.0.58", optional = true}
|
||||
|
||||
[dev-dependencies]
|
||||
tempdir = "~0.3.4"
|
||||
|
17
src/error.rs
17
src/error.rs
@ -143,18 +143,19 @@ impl error::Error for Error {
|
||||
fn cause(&self) -> Option<&error::Error> {
|
||||
match *self {
|
||||
Error::SqliteFailure(ref err, _) => Some(err),
|
||||
Error::SqliteSingleThreadedMode => None,
|
||||
Error::FromSqlConversionFailure(ref err) => Some(&**err),
|
||||
Error::Utf8Error(ref err) => Some(err),
|
||||
Error::NulError(ref err) => Some(err),
|
||||
Error::InvalidParameterName(_) => None,
|
||||
|
||||
Error::SqliteSingleThreadedMode |
|
||||
Error::InvalidParameterName(_) |
|
||||
Error::ExecuteReturnedResults |
|
||||
Error::QueryReturnedNoRows |
|
||||
Error::GetFromStaleRow |
|
||||
Error::InvalidColumnIndex(_) |
|
||||
Error::InvalidColumnName(_) |
|
||||
Error::InvalidColumnType |
|
||||
Error::InvalidPath(_) => None,
|
||||
Error::ExecuteReturnedResults => None,
|
||||
Error::QueryReturnedNoRows => None,
|
||||
Error::GetFromStaleRow => None,
|
||||
Error::InvalidColumnIndex(_) => None,
|
||||
Error::InvalidColumnName(_) => None,
|
||||
Error::InvalidColumnType => None,
|
||||
|
||||
#[cfg(feature = "functions")]
|
||||
Error::InvalidFunctionParameterType => None,
|
||||
|
@ -53,6 +53,9 @@
|
||||
#![cfg_attr(feature="clippy", feature(plugin))]
|
||||
#![cfg_attr(feature="clippy", plugin(clippy))]
|
||||
|
||||
// Clippy complains about SQLite in our doc comments, but they're fine.
|
||||
#![cfg_attr(feature="clippy", allow(doc_markdown))]
|
||||
|
||||
extern crate libc;
|
||||
extern crate libsqlite3_sys as ffi;
|
||||
#[macro_use]
|
||||
@ -791,10 +794,10 @@ impl<'conn> Statement<'conn> {
|
||||
ffi::sqlite3_reset(self.stmt);
|
||||
match r {
|
||||
ffi::SQLITE_DONE => {
|
||||
if self.column_count != 0 {
|
||||
Err(Error::ExecuteReturnedResults)
|
||||
} else {
|
||||
if self.column_count == 0 {
|
||||
Ok(self.conn.changes())
|
||||
} else {
|
||||
Err(Error::ExecuteReturnedResults)
|
||||
}
|
||||
}
|
||||
ffi::SQLITE_ROW => Err(Error::ExecuteReturnedResults),
|
||||
|
Loading…
Reference in New Issue
Block a user