mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-26 03:11:36 +08:00
commit
94ed61c44c
@ -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"
|
||||
|
@ -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.
|
||||
|
14
src/lib.rs
14
src/lib.rs
@ -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<()> {
|
||||
|
Loading…
Reference in New Issue
Block a user