mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-22 16:29:20 +08:00
Merge pull request #83 from jgallagher/gwenn-debug
Use debug_struct for formatting.
This commit is contained in:
commit
30ce399e91
10
src/lib.rs
10
src/lib.rs
@ -444,7 +444,9 @@ impl SqliteConnection {
|
|||||||
|
|
||||||
impl fmt::Debug 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( path: {:?} )", &self.path)
|
f.debug_struct("SqliteConnection")
|
||||||
|
.field("path", &self.path)
|
||||||
|
.finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -780,7 +782,11 @@ impl<'conn> fmt::Debug for SqliteStatement<'conn> {
|
|||||||
let c_slice = CStr::from_ptr(ffi::sqlite3_sql(self.stmt)).to_bytes();
|
let c_slice = CStr::from_ptr(ffi::sqlite3_sql(self.stmt)).to_bytes();
|
||||||
str::from_utf8(c_slice)
|
str::from_utf8(c_slice)
|
||||||
};
|
};
|
||||||
write!(f, "SqliteStatement( conn: {:?}, stmt: {:?}, sql: {:?} )", self.conn, self.stmt, sql)
|
f.debug_struct("SqliteStatement")
|
||||||
|
.field("conn", self.conn)
|
||||||
|
.field("stmt", &self.stmt)
|
||||||
|
.field("sql", &sql)
|
||||||
|
.finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user