Use sqlite_error_code where possible

This commit is contained in:
gwenn
2022-04-07 09:15:55 +02:00
parent f54e550b2b
commit fedf6b41ae
2 changed files with 9 additions and 15 deletions

View File

@@ -1742,14 +1742,10 @@ mod test {
let result: Result<Vec<i32>> = stmt.query([])?.map(|r| r.get(0)).collect();
match result.unwrap_err() {
Error::SqliteFailure(err, _) => {
assert_eq!(err.code, ErrorCode::OperationInterrupted);
}
err => {
panic!("Unexpected error {}", err);
}
}
assert_eq!(
result.unwrap_err().sqlite_error_code(),
Some(ErrorCode::OperationInterrupted)
);
Ok(())
}