Skip to content

Commit

Permalink
Docs: make sure it's hard to miss that type name has to match
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
vargad committed Oct 7, 2022
1 parent 71668b7 commit 79151c5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions postgres-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
//!
//! # #[cfg(feature = "derive")]
//! #[derive(Debug, ToSql, FromSql)]
//! #[postgres(name = "Mood")]
//! enum Mood {
//! Sad,
//! Ok,
Expand All @@ -52,6 +53,7 @@
//!
//! # #[cfg(feature = "derive")]
//! #[derive(Debug, ToSql, FromSql)]
//! #[postgres(name = "SessionId")]
//! struct SessionId(Vec<u8>);
//! ```
//!
Expand Down Expand Up @@ -88,6 +90,7 @@
//!
//! # #[cfg(feature = "derive")]
//! #[derive(Debug, ToSql, FromSql)]
//! #[postgres(name = "InventoryItem")]
//! struct InventoryItem {
//! name: String,
//! supplier_id: i32,
Expand Down

0 comments on commit 79151c5

Please sign in to comment.