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
2d75411e44
commit
0cf9ef8514
@ -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])
|
||||||
/// }
|
/// }
|
||||||
|
@ -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(),
|
||||||
|
@ -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(),
|
||||||
|
@ -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.
|
||||||
|
Loading…
Reference in New Issue
Block a user