Rework ToSql to be implementable without unsafe.

This commit is contained in:
John Gallagher
2016-05-25 22:57:43 -04:00
parent 9e49452300
commit e4926ac0d7
10 changed files with 206 additions and 122 deletions

View File

@@ -182,7 +182,7 @@ impl<'a> ValueRef<'a> {
ValueRef::Blob(from_raw_parts(blob as *const u8, len as usize))
}
_ => unreachable!("sqlite3_value_type returned invalid value")
_ => unreachable!("sqlite3_value_type returned invalid value"),
}
}
}
@@ -219,7 +219,7 @@ impl<'a> Context<'a> {
let value = unsafe { ValueRef::from_value(arg) };
FromSql::column_result(value).map_err(|err| match err {
Error::InvalidColumnType => Error::InvalidFunctionParameterType,
_ => err
_ => err,
})
}