Skip to content

Commit 7e0f10d

Browse files
committed
Cleanups
1 parent fa3241e commit 7e0f10d

File tree

1 file changed

+7
-19
lines changed
  • tokio-postgres/src/types

1 file changed

+7
-19
lines changed

tokio-postgres/src/types/mod.rs

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,7 @@ impl fmt::Display for Type {
106106
}
107107

108108
impl Type {
109-
// WARNING: this is not considered public API
110-
#[doc(hidden)]
111-
pub fn _new(name: String, oid: Oid, kind: Kind, schema: String) -> Type {
109+
pub(crate) fn _new(name: String, oid: Oid, kind: Kind, schema: String) -> Type {
112110
Type(Inner::Other(Arc::new(Other {
113111
name,
114112
oid,
@@ -165,7 +163,7 @@ pub enum Kind {
165163
/// A composite type along with information about its fields.
166164
Composite(Vec<Field>),
167165
#[doc(hidden)]
168-
__PseudoPrivateForExtensibility,
166+
__ForExtensibility,
169167
}
170168

171169
/// Information about a field of a composite type.
@@ -188,8 +186,7 @@ impl Field {
188186
}
189187

190188
impl Field {
191-
#[doc(hidden)]
192-
pub fn new(name: String, type_: Type) -> Field {
189+
pub(crate) fn new(name: String, type_: Type) -> Field {
193190
Field { name, type_ }
194191
}
195192
}
@@ -201,15 +198,11 @@ pub struct WasNull;
201198

202199
impl fmt::Display for WasNull {
203200
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
204-
fmt.write_str(self.description())
201+
fmt.write_str("a Postgres value was `NULL`")
205202
}
206203
}
207204

208-
impl Error for WasNull {
209-
fn description(&self) -> &str {
210-
"a Postgres value was `NULL`"
211-
}
212-
}
205+
impl Error for WasNull {}
213206

214207
/// An error indicating that a conversion was attempted between incompatible
215208
/// Rust and Postgres types.
@@ -226,15 +219,10 @@ impl fmt::Display for WrongType {
226219
}
227220
}
228221

229-
impl Error for WrongType {
230-
fn description(&self) -> &str {
231-
"cannot convert to or from a Postgres value"
232-
}
233-
}
222+
impl Error for WrongType {}
234223

235224
impl WrongType {
236-
#[doc(hidden)]
237-
pub fn new(ty: Type) -> WrongType {
225+
pub(crate) fn new(ty: Type) -> WrongType {
238226
WrongType(ty)
239227
}
240228
}

0 commit comments

Comments
 (0)