Skip to content

Commit 8787615

Browse files
committed
Simplify Debug impl of Column
1 parent 02bab67 commit 8787615

File tree

2 files changed

+4
-15
lines changed

2 files changed

+4
-15
lines changed

tokio-postgres/src/prepare.rs

+1-1
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

+3-14
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use crate::connection::RequestMessages;
44
use crate::types::Type;
55
use postgres_protocol::message::frontend;
66
use std::{
7-
fmt,
87
num::{NonZeroI16, NonZeroU32},
98
sync::{Arc, Weak},
109
};
@@ -66,11 +65,12 @@ impl Statement {
6665
}
6766

6867
/// Information about a column of a query.
68+
#[derive(Debug)]
6969
pub struct Column {
7070
pub(crate) name: String,
7171
pub(crate) table_oid: Option<NonZeroU32>,
7272
pub(crate) column_id: Option<NonZeroI16>,
73-
pub(crate) type_: Type,
73+
pub(crate) r#type: Type,
7474
}
7575

7676
impl Column {
@@ -91,17 +91,6 @@ impl Column {
9191

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

0 commit comments

Comments
 (0)