mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-22 16:29:20 +08:00
commit
5cbfe56bf7
@ -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<T>` 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<usize> {
|
||||
/// 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
|
||||
where T: Into<Value> {
|
||||
impl<T> From<Option<T>> for Value
|
||||
where
|
||||
T: Into<Value>,
|
||||
{
|
||||
fn from(v: Option<T>) -> Value {
|
||||
match v {
|
||||
Some(x) => x.into(),
|
||||
|
@ -110,8 +110,10 @@ impl<'a> From<&'a Value> for ValueRef<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, T> From<Option<T>> for ValueRef<'a>
|
||||
where T: Into<ValueRef<'a>> {
|
||||
impl<'a, T> From<Option<T>> for ValueRef<'a>
|
||||
where
|
||||
T: Into<ValueRef<'a>>,
|
||||
{
|
||||
fn from(s: Option<T>) -> ValueRef<'a> {
|
||||
match s {
|
||||
Some(x) => x.into(),
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user