mirror of
				https://github.com/isar/rusqlite.git
				synced 2025-10-31 22:08:55 +08:00 
			
		
		
		
	| @@ -1,6 +1,6 @@ | |||||||
| [package] | [package] | ||||||
| name = "rusqlite" | name = "rusqlite" | ||||||
| version = "0.0.8" | version = "0.0.9" | ||||||
| authors = ["John Gallagher <jgallagher@bignerdranch.com>"] | authors = ["John Gallagher <jgallagher@bignerdranch.com>"] | ||||||
| description = "Ergonomic wrapper for SQLite" | description = "Ergonomic wrapper for SQLite" | ||||||
| homepage = "https://github.com/jgallagher/rusqlite" | homepage = "https://github.com/jgallagher/rusqlite" | ||||||
|   | |||||||
| @@ -1,3 +1,8 @@ | |||||||
|  | # Version 0.0.9 (2015-02-13) | ||||||
|  |  | ||||||
|  | * Updates to track latest rustc changes. | ||||||
|  | * Implement standard `Error` trait for `SqliteError`. | ||||||
|  |  | ||||||
| # Version 0.0.8 (2015-02-04) | # Version 0.0.8 (2015-02-04) | ||||||
|  |  | ||||||
| * Updates to track latest rustc changes. | * Updates to track latest rustc changes. | ||||||
|   | |||||||
							
								
								
									
										14
									
								
								src/lib.rs
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								src/lib.rs
									
									
									
									
									
								
							| @@ -57,6 +57,7 @@ extern crate libc; | |||||||
| use std::mem; | use std::mem; | ||||||
| use std::ptr; | use std::ptr; | ||||||
| use std::fmt; | use std::fmt; | ||||||
|  | use std::error; | ||||||
| use std::rc::{Rc}; | use std::rc::{Rc}; | ||||||
| use std::cell::{RefCell, Cell}; | use std::cell::{RefCell, Cell}; | ||||||
| use std::ffi::{CString}; | use std::ffi::{CString}; | ||||||
| @@ -100,8 +101,14 @@ pub struct SqliteError { | |||||||
| } | } | ||||||
|  |  | ||||||
| impl fmt::Display for SqliteError { | impl fmt::Display for SqliteError { | ||||||
|     fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { |     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { | ||||||
|         write!(f, "SqliteError( code: {}, message: {} )", self.code, self.message) |         write!(f, "{} (SQLite error {})", self.message, self.code) | ||||||
|  |     } | ||||||
|  | } | ||||||
|  |  | ||||||
|  | impl error::Error for SqliteError { | ||||||
|  |     fn description(&self) -> &str { | ||||||
|  |         self.message.as_slice() | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -311,7 +318,8 @@ impl SqliteConnection { | |||||||
|     /// This is functionally equivalent to the `Drop` implementation for `SqliteConnection` except |     /// This is functionally equivalent to the `Drop` implementation for `SqliteConnection` except | ||||||
|     /// that it returns any error encountered to the caller. |     /// that it returns any error encountered to the caller. | ||||||
|     pub fn close(self) -> SqliteResult<()> { |     pub fn close(self) -> SqliteResult<()> { | ||||||
|         self.db.borrow_mut().close() |         let mut db = self.db.borrow_mut(); | ||||||
|  |         db.close() | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     fn decode_result(&self, code: c_int) -> SqliteResult<()> { |     fn decode_result(&self, code: c_int) -> SqliteResult<()> { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user