Skip to content

Commit 9a6221c

Browse files
committed
Docs: make sure it's hard to miss that type name has to match
Some people (me) doesn't read the full page or just gloss over the naming section. It's a lot of wasted time debugging the issue when the type name is not matching, adding name attribute to the examples makes it really hard to miss.
1 parent 71668b7 commit 9a6221c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

postgres-types/src/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
//!
3232
//! # #[cfg(feature = "derive")]
3333
//! #[derive(Debug, ToSql, FromSql)]
34+
//! // #[postgres(name = "Mood")] /* in case type name is different */
3435
//! enum Mood {
3536
//! Sad,
3637
//! Ok,
@@ -52,6 +53,7 @@
5253
//!
5354
//! # #[cfg(feature = "derive")]
5455
//! #[derive(Debug, ToSql, FromSql)]
56+
//! // #[postgres(name = "SessionId")] /* in case type name is different */
5557
//! struct SessionId(Vec<u8>);
5658
//! ```
5759
//!
@@ -88,6 +90,7 @@
8890
//!
8991
//! # #[cfg(feature = "derive")]
9092
//! #[derive(Debug, ToSql, FromSql)]
93+
//! // #[postgres(name = "InventoryItem")] /* in case type name is different */
9194
//! struct InventoryItem {
9295
//! name: String,
9396
//! supplier_id: i32,

0 commit comments

Comments
 (0)