Use From for convertin codes to error kinds

This commit is contained in:
Ivan Ukhov
2015-06-08 18:19:15 -04:00
parent 15539354b4
commit d036ddc071
2 changed files with 11 additions and 10 deletions

View File

@ -14,7 +14,7 @@ macro_rules! failure(
($database:expr, $code:expr) => (
match ::error::last($database) {
Some(error) => return Err(error),
None => return Err(::Error::from(::error::kind_from_code($code))),
None => return Err(::Error::from(::ErrorKind::from($code as isize))),
}
);
);
@ -29,7 +29,7 @@ macro_rules! success(
($result:expr) => (
match $result {
::raw::SQLITE_OK => {},
code => return Err(::Error::from(::error::kind_from_code(code))),
code => return Err(::Error::from(::ErrorKind::from(code as isize))),
}
);
);