mirror of
https://github.com/isar/rusqlite.git
synced 2025-11-02 23:08:58 +08:00
Use sqlite_error_code where possible
This commit is contained in:
12
src/lib.rs
12
src/lib.rs
@@ -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(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user