Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8787615

Browse files
committed
Simplify Debug impl of Column
1 parent02bab67 commit8787615

File tree

2 files changed

+4
-15
lines changed

2 files changed

+4
-15
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 & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use crate::connection::RequestMessages;
44
usecrate::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
pubstructColumn{
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
implColumn{
@@ -91,17 +91,6 @@ impl Column {
9191

9292
/// Returns the type of the column.
9393
pubfntype_(&self) ->&Type{
94-
&self.type_
95-
}
96-
}
97-
98-
impl fmt::DebugforColumn{
99-
fnfmt(&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)

[8]ページ先頭

©2009-2025 Movatter.jp