mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-22 16:29:20 +08:00
Use debug_struct for formatting.
This commit is contained in:
parent
7586556db5
commit
0729e195c3
10
src/lib.rs
10
src/lib.rs
@ -444,7 +444,9 @@ impl SqliteConnection {
|
||||
|
||||
impl fmt::Debug for SqliteConnection {
|
||||
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();
|
||||
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