Introduce an intermediary InvalidType error.

InvalidType is used where the column/parameter index is not known.
This commit is contained in:
gwenn
2016-05-30 20:35:56 +02:00
parent cabcaf3dcb
commit fb19e718cf
8 changed files with 55 additions and 43 deletions

View File

@@ -16,8 +16,8 @@ impl ToSql for time::Timespec {
}
impl FromSql for time::Timespec {
fn column_result(value: ValueRef, idx: i32) -> Result<Self> {
value.as_str(idx).and_then(|s| match time::strptime(s, SQLITE_DATETIME_FMT) {
fn column_result(value: ValueRef) -> Result<Self> {
value.as_str().and_then(|s| match time::strptime(s, SQLITE_DATETIME_FMT) {
Ok(tm) => Ok(tm.to_timespec()),
Err(err) => Err(Error::FromSqlConversionFailure(Box::new(err))),
})