From 0cf9ef8514461d945ef89e89931d5fa58bc964b3 Mon Sep 17 00:00:00 2001 From: gwenn Date: Sun, 13 Oct 2019 13:08:33 +0200 Subject: [PATCH] Fix some clippy warnings --- src/types/mod.rs | 6 +----- src/types/value.rs | 6 ++++-- src/types/value_ref.rs | 6 ++++-- src/vtab/csvtab.rs | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/types/mod.rs b/src/types/mod.rs index aee4564..493dbeb 100644 --- a/src/types/mod.rs +++ b/src/types/mod.rs @@ -42,10 +42,6 @@ //! 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` where `T` @@ -78,7 +74,7 @@ mod value_ref; /// ```rust,no_run /// # use rusqlite::{Connection, Result}; /// # use rusqlite::types::{Null}; -/// fn main() {} +/// /// fn insert_null(conn: &Connection) -> Result { /// conn.execute("INSERT INTO people (name) VALUES (?)", &[Null]) /// } diff --git a/src/types/value.rs b/src/types/value.rs index 00295e7..332d78b 100644 --- a/src/types/value.rs +++ b/src/types/value.rs @@ -96,8 +96,10 @@ impl From> for Value { } } -impl From> for Value - where T: Into { +impl From> for Value +where + T: Into, +{ fn from(v: Option) -> Value { match v { Some(x) => x.into(), diff --git a/src/types/value_ref.rs b/src/types/value_ref.rs index acc9aa6..503f905 100644 --- a/src/types/value_ref.rs +++ b/src/types/value_ref.rs @@ -110,8 +110,10 @@ impl<'a> From<&'a Value> for ValueRef<'a> { } } -impl<'a, T> From> for ValueRef<'a> - where T: Into> { +impl<'a, T> From> for ValueRef<'a> +where + T: Into>, +{ fn from(s: Option) -> ValueRef<'a> { match s { Some(x) => x.into(), diff --git a/src/vtab/csvtab.rs b/src/vtab/csvtab.rs index acae3fc..4f26a08 100644 --- a/src/vtab/csvtab.rs +++ b/src/vtab/csvtab.rs @@ -235,7 +235,7 @@ impl VTab for CSVTab { schema = Some(sql); } - Ok((schema.unwrap().to_owned(), vtab)) + Ok((schema.unwrap(), vtab)) } // Only a forward full table scan is supported.