File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,14 @@ impl<'a> SessionInfo<'a> {
90
90
}
91
91
}
92
92
93
+ impl < ' a > fmt:: Debug for SessionInfo < ' a > {
94
+ fn fmt ( & self , fmt : & mut fmt:: Formatter ) -> fmt:: Result {
95
+ fmt. debug_struct ( "SessionInfo" )
96
+ . field ( "parameters" , & self . conn . parameters )
97
+ . finish ( )
98
+ }
99
+ }
100
+
93
101
/// A Postgres OID.
94
102
pub type Oid = u32 ;
95
103
@@ -137,6 +145,16 @@ macro_rules! make_postgres_type {
137
145
}
138
146
}
139
147
148
+ impl fmt:: Display for Type {
149
+ fn fmt( & self , fmt: & mut fmt:: Formatter ) -> fmt:: Result {
150
+ match self . schema( ) {
151
+ "public" | "pg_catalog" => { }
152
+ schema => try!( write!( fmt, "{}." , schema) ) ,
153
+ }
154
+ fmt. write_str( self . name( ) )
155
+ }
156
+ }
157
+
140
158
impl Type {
141
159
/// Returns the `Type` corresponding to the provided `Oid` if it
142
160
/// corresponds to a built-in type.
@@ -571,7 +589,7 @@ pub struct WrongType(Type);
571
589
572
590
impl fmt:: Display for WrongType {
573
591
fn fmt ( & self , fmt : & mut fmt:: Formatter ) -> fmt:: Result {
574
- write ! ( fmt, "cannot convert to or from a Postgres value of type {:?} " , self . 0 )
592
+ write ! ( fmt, "cannot convert to or from a Postgres value of type `{}` " , self . 0 )
575
593
}
576
594
}
577
595
You can’t perform that action at this time.
0 commit comments