Skip to content

Commit 388c7b7

Browse files
committed
Simplify Debug impl of Column
1 parent f17e927 commit 388c7b7

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

tokio-postgres/src/prepare.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ pub async fn prepare(
100100
name: field.name().to_string(),
101101
table_oid: NonZeroU32::new(field.table_oid()),
102102
column_id: NonZeroI16::new(field.column_id()),
103-
type_,
103+
r#type: type_,
104104
};
105105
columns.push(column);
106106
}

tokio-postgres/src/statement.rs

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,12 @@ impl Statement {
6666
}
6767

6868
/// Information about a column of a query.
69+
#[derive(Debug)]
6970
pub struct Column {
7071
pub(crate) name: String,
7172
pub(crate) table_oid: Option<NonZeroU32>,
7273
pub(crate) column_id: Option<NonZeroI16>,
73-
pub(crate) type_: Type,
74+
pub(crate) r#type: Type,
7475
}
7576

7677
impl Column {
@@ -92,17 +93,6 @@ impl Column {
9293

9394
/// Returns the type of the column.
9495
pub fn type_(&self) -> &Type {
95-
&self.type_
96-
}
97-
}
98-
99-
impl fmt::Debug for Column {
100-
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
101-
fmt.debug_struct("Column")
102-
.field("name", &self.name)
103-
.field("table_oid", &self.table_oid)
104-
.field("column_id", &self.column_id)
105-
.field("type", &self.type_)
106-
.finish()
96+
&self.r#type
10797
}
10898
}

0 commit comments

Comments
 (0)