mirror of
https://github.com/isar/rusqlite.git
synced 2025-08-19 12:29:34 +08:00
Change Error
from a struct to an enum (BREAKING CHANGE).
This allows us to separate out the underlying SQLite error codes from errors that occur on the Rust side.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
use libc::c_int;
|
||||
use std::error;
|
||||
use std::fmt;
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
@@ -77,6 +78,12 @@ impl fmt::Display for Error {
|
||||
}
|
||||
}
|
||||
|
||||
impl error::Error for Error {
|
||||
fn description(&self) -> &str {
|
||||
code_to_str(self.extended_code)
|
||||
}
|
||||
}
|
||||
|
||||
// Result codes.
|
||||
|
||||
pub const SQLITE_OK : c_int = 0;
|
||||
|
Reference in New Issue
Block a user