mirror of
https://github.com/isar/rusqlite.git
synced 2025-11-02 14:58:56 +08:00
Parse Option<T> into Value/ValueRef where applicable
This commit is contained in:
@@ -96,6 +96,16 @@ impl From<Vec<u8>> for Value {
|
||||
}
|
||||
}
|
||||
|
||||
impl <T> From<Option<T>> for Value
|
||||
where T: Into<Value> {
|
||||
fn from(v: Option<T>) -> Value {
|
||||
match v {
|
||||
Some(x) => x.into(),
|
||||
None => Value::Null,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Value {
|
||||
pub fn data_type(&self) -> Type {
|
||||
match *self {
|
||||
|
||||
Reference in New Issue
Block a user