Merge pull request #20 from jgallagher/v0.0.9

PR for 0.0.9 bump
This commit is contained in:
John Gallagher 2015-02-13 15:53:13 -05:00
commit 94ed61c44c
3 changed files with 17 additions and 4 deletions

View File

@ -1,6 +1,6 @@
[package]
name = "rusqlite"
version = "0.0.8"
version = "0.0.9"
authors = ["John Gallagher <jgallagher@bignerdranch.com>"]
description = "Ergonomic wrapper for SQLite"
homepage = "https://github.com/jgallagher/rusqlite"

View File

@ -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)
* Updates to track latest rustc changes.

View File

@ -57,6 +57,7 @@ extern crate libc;
use std::mem;
use std::ptr;
use std::fmt;
use std::error;
use std::rc::{Rc};
use std::cell::{RefCell, Cell};
use std::ffi::{CString};
@ -100,8 +101,14 @@ pub struct SqliteError {
}
impl fmt::Display for SqliteError {
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
write!(f, "SqliteError( code: {}, message: {} )", self.code, self.message)
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
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
/// that it returns any error encountered to the caller.
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<()> {