From 58fa5bde2ae93ef902175f9e20813a30f0630971 Mon Sep 17 00:00:00 2001 From: Patrick Fernie Date: Tue, 3 Feb 2015 18:59:58 -0500 Subject: [PATCH 1/2] update to use fmt::{Display,Debug} instead of fmt::{String,Show} --- README.md | 2 +- src/lib.rs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index fb44ef1..3518b7b 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ extern crate time; use time::Timespec; use rusqlite::SqliteConnection; -#[derive(Show)] +#[derive(Debug)] struct Person { id: i32, name: String, diff --git a/src/lib.rs b/src/lib.rs index bab59cd..2e2edb5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -9,7 +9,7 @@ //! use time::Timespec; //! use rusqlite::SqliteConnection; //! -//! #[derive(Show)] +//! #[derive(Debug)] //! struct Person { //! id: i32, //! 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. -#[derive(Show)] +#[derive(Debug)] pub struct SqliteError { /// The error code returned by a SQLite C API call. See [SQLite Result /// Codes](http://www.sqlite.org/rescode.html) for details. @@ -99,7 +99,7 @@ pub struct SqliteError { pub message: String, } -impl fmt::String for 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) } @@ -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 { 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 { write!(f, "Statement( conn: {:?}, stmt: {:?} )", self.conn, self.stmt) } From ec65bc4978c3facdab134dada4ad0dbaeff7f805 Mon Sep 17 00:00:00 2001 From: Patrick Fernie Date: Tue, 3 Feb 2015 19:01:24 -0500 Subject: [PATCH 2/2] add feature attributes for unstable APIs --- src/lib.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 2e2edb5..54f18ac 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -48,8 +48,7 @@ //! } //! } //! ``` -#![feature(unsafe_destructor)] -#![allow(unstable)] +#![feature(unsafe_destructor, core, std_misc, libc, rustc_private, collections, hash)] extern crate libc; #[macro_use] extern crate rustc_bitflags;