mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-26 11:31:37 +08:00
Implement fmt::String for SqliteError
This commit is contained in:
parent
8843d15a07
commit
680056b351
@ -96,6 +96,12 @@ pub struct SqliteError {
|
|||||||
pub message: String,
|
pub message: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl fmt::String for SqliteError {
|
||||||
|
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
||||||
|
write!(f, "SqliteError( code: {}, message: {} )", self.code, self.message)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl SqliteError {
|
impl SqliteError {
|
||||||
fn from_handle(db: *mut ffi::Struct_sqlite3, code: c_int) -> SqliteError {
|
fn from_handle(db: *mut ffi::Struct_sqlite3, code: c_int) -> SqliteError {
|
||||||
let message = if db.is_null() {
|
let message = if db.is_null() {
|
||||||
|
Loading…
Reference in New Issue
Block a user