mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-23 00:39:20 +08:00
update to use fmt::{Display,Debug} instead of fmt::{String,Show}
This commit is contained in:
parent
88d0566010
commit
58fa5bde2a
@ -13,7 +13,7 @@ extern crate time;
|
|||||||
use time::Timespec;
|
use time::Timespec;
|
||||||
use rusqlite::SqliteConnection;
|
use rusqlite::SqliteConnection;
|
||||||
|
|
||||||
#[derive(Show)]
|
#[derive(Debug)]
|
||||||
struct Person {
|
struct Person {
|
||||||
id: i32,
|
id: i32,
|
||||||
name: String,
|
name: String,
|
||||||
|
10
src/lib.rs
10
src/lib.rs
@ -9,7 +9,7 @@
|
|||||||
//! use time::Timespec;
|
//! use time::Timespec;
|
||||||
//! use rusqlite::SqliteConnection;
|
//! use rusqlite::SqliteConnection;
|
||||||
//!
|
//!
|
||||||
//! #[derive(Show)]
|
//! #[derive(Debug)]
|
||||||
//! struct Person {
|
//! struct Person {
|
||||||
//! id: i32,
|
//! id: i32,
|
||||||
//! name: String,
|
//! name: String,
|
||||||
@ -88,7 +88,7 @@ unsafe fn errmsg_to_string(errmsg: *const c_char) -> String {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Encompasses an error result from a call to the SQLite C API.
|
/// Encompasses an error result from a call to the SQLite C API.
|
||||||
#[derive(Show)]
|
#[derive(Debug)]
|
||||||
pub struct SqliteError {
|
pub struct SqliteError {
|
||||||
/// The error code returned by a SQLite C API call. See [SQLite Result
|
/// The error code returned by a SQLite C API call. See [SQLite Result
|
||||||
/// Codes](http://www.sqlite.org/rescode.html) for details.
|
/// Codes](http://www.sqlite.org/rescode.html) for details.
|
||||||
@ -99,7 +99,7 @@ pub struct SqliteError {
|
|||||||
pub message: String,
|
pub message: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::String for SqliteError {
|
impl fmt::Display for SqliteError {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
||||||
write!(f, "SqliteError( code: {}, message: {} )", self.code, self.message)
|
write!(f, "SqliteError( code: {}, message: {} )", self.code, self.message)
|
||||||
}
|
}
|
||||||
@ -323,7 +323,7 @@ impl SqliteConnection {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Show for SqliteConnection {
|
impl fmt::Debug for SqliteConnection {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
write!(f, "SqliteConnection()")
|
write!(f, "SqliteConnection()")
|
||||||
}
|
}
|
||||||
@ -547,7 +547,7 @@ impl<'conn> SqliteStatement<'conn> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'conn> fmt::Show for SqliteStatement<'conn> {
|
impl<'conn> fmt::Debug for SqliteStatement<'conn> {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
write!(f, "Statement( conn: {:?}, stmt: {:?} )", self.conn, self.stmt)
|
write!(f, "Statement( conn: {:?}, stmt: {:?} )", self.conn, self.stmt)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user