From 680056b3514776a911611e698d770e434d6d298b Mon Sep 17 00:00:00 2001 From: John Gallagher Date: Sat, 10 Jan 2015 20:50:03 -0600 Subject: [PATCH] Implement fmt::String for SqliteError --- src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 161c36f..e9d6037 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -96,6 +96,12 @@ pub struct SqliteError { 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 { fn from_handle(db: *mut ffi::Struct_sqlite3, code: c_int) -> SqliteError { let message = if db.is_null() {