mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-23 00:39:20 +08:00
Fix some clippy warnings
This commit is contained in:
parent
626118ce07
commit
dc49b28520
@ -8,7 +8,7 @@ use std::str;
|
|||||||
|
|
||||||
/// Enum listing possible errors from rusqlite.
|
/// Enum listing possible errors from rusqlite.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
#[allow(enum_variant_names)]
|
#[allow(clippy::enum_variant_names)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
/// An error from an underlying SQLite call.
|
/// An error from an underlying SQLite call.
|
||||||
SqliteFailure(ffi::Error, Option<String>),
|
SqliteFailure(ffi::Error, Option<String>),
|
||||||
|
@ -27,7 +27,7 @@ impl<'stmt> Rows<'stmt> {
|
|||||||
/// This is a "streaming iterator". For a more natural interface,
|
/// This is a "streaming iterator". For a more natural interface,
|
||||||
/// consider using `query_map` or `query_and_then` instead, which
|
/// consider using `query_map` or `query_and_then` instead, which
|
||||||
/// return types that implement `Iterator`.
|
/// return types that implement `Iterator`.
|
||||||
#[cfg_attr(feature = "cargo-clippy", allow(should_implement_trait))] // cannot implement Iterator
|
#[allow(clippy::should_implement_trait)] // cannot implement Iterator
|
||||||
pub fn next<'a>(&'a mut self) -> Option<Result<Row<'a, 'stmt>>> {
|
pub fn next<'a>(&'a mut self) -> Option<Result<Row<'a, 'stmt>>> {
|
||||||
self.stmt.and_then(|stmt| match stmt.step() {
|
self.stmt.and_then(|stmt| match stmt.step() {
|
||||||
Ok(true) => Some(Ok(Row {
|
Ok(true) => Some(Ok(Row {
|
||||||
|
@ -47,7 +47,7 @@ impl Error for FromSqlError {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg_attr(feature = "clippy", allow(match_same_arms))]
|
#[allow(clippy::match_same_arms)]
|
||||||
fn cause(&self) -> Option<&Error> {
|
fn cause(&self) -> Option<&Error> {
|
||||||
match *self {
|
match *self {
|
||||||
FromSqlError::Other(ref err) => err.cause(),
|
FromSqlError::Other(ref err) => err.cause(),
|
||||||
|
Loading…
Reference in New Issue
Block a user