Fix some clippy warnings

This commit is contained in:
gwenn 2019-10-13 13:08:33 +02:00
parent 2d75411e44
commit 0cf9ef8514
4 changed files with 10 additions and 10 deletions

View File

@ -42,10 +42,6 @@
//! Ok(as_f64.into()) //! Ok(as_f64.into())
//! } //! }
//! } //! }
//!
//! # // Prevent this doc test from being wrapped in a `fn main()` so that it
//! # // will compile.
//! # fn main() {}
//! ``` //! ```
//! //!
//! `ToSql` and `FromSql` are also implemented for `Option<T>` where `T` //! `ToSql` and `FromSql` are also implemented for `Option<T>` where `T`
@ -78,7 +74,7 @@ mod value_ref;
/// ```rust,no_run /// ```rust,no_run
/// # use rusqlite::{Connection, Result}; /// # use rusqlite::{Connection, Result};
/// # use rusqlite::types::{Null}; /// # use rusqlite::types::{Null};
/// fn main() {} ///
/// fn insert_null(conn: &Connection) -> Result<usize> { /// fn insert_null(conn: &Connection) -> Result<usize> {
/// conn.execute("INSERT INTO people (name) VALUES (?)", &[Null]) /// conn.execute("INSERT INTO people (name) VALUES (?)", &[Null])
/// } /// }

View File

@ -96,8 +96,10 @@ impl From<Vec<u8>> for Value {
} }
} }
impl <T> From<Option<T>> for Value impl<T> From<Option<T>> for Value
where T: Into<Value> { where
T: Into<Value>,
{
fn from(v: Option<T>) -> Value { fn from(v: Option<T>) -> Value {
match v { match v {
Some(x) => x.into(), Some(x) => x.into(),

View File

@ -111,7 +111,9 @@ impl<'a> From<&'a Value> for ValueRef<'a> {
} }
impl<'a, T> From<Option<T>> for ValueRef<'a> impl<'a, T> From<Option<T>> for ValueRef<'a>
where T: Into<ValueRef<'a>> { where
T: Into<ValueRef<'a>>,
{
fn from(s: Option<T>) -> ValueRef<'a> { fn from(s: Option<T>) -> ValueRef<'a> {
match s { match s {
Some(x) => x.into(), Some(x) => x.into(),

View File

@ -235,7 +235,7 @@ impl VTab for CSVTab {
schema = Some(sql); schema = Some(sql);
} }
Ok((schema.unwrap().to_owned(), vtab)) Ok((schema.unwrap(), vtab))
} }
// Only a forward full table scan is supported. // Only a forward full table scan is supported.