Repository: diesel-rs/diesel
File: diesel/src/pg/types/mod.rs (Rust)

Code before:
    ///
    /// ### [`FromSql`] impls
    ///
    /// - [`Vec<T>`][Vec] for any `T` which implements `ToSql<ST>`
    ///
    /// [`ToSql`]: crate::serialize::ToSql
    /// [`FromSql`]: crate::deserialize::FromSql
    /// [Vec]: std::vec::Vec
    /// [slice]: https://doc.rust-lang.org/nightly/std/primitive.slice.html
    /// [`Array`]: https://www.postgresql.org/docs/current/arrays.html
    #[derive(Debug, Clone, Copy, Default, QueryId, SqlType)]
    #[cfg(feature = "postgres_backend")]
    pub struct Array<ST: 'static>(ST);

    /// The [`Range`] SQL type.
    ///
    /// This wraps another type to represent a SQL range of that type.
    ///
    /// ### [`ToSql`] impls
    ///
    /// - [`(Bound<T>, Bound<T>)`][bound] for any `T` which implements `ToSql<ST>`.
    /// - [`Range<T>`][std::range] for any `T` which implements `ToSql<ST>`.
    /// - [`RangeInclusive<T>`] for any `T` which implements `ToSql<ST>`.
    /// - [`RangeFrom<T>`] for any `T` which implements `ToSql<ST>`.
    /// - [`RangeTo<T>`] for any `T` which implements `ToSql<ST>`.
    /// - [`RangeToInclusive<T>`] for any `T` which implements `ToSql<ST>`.
    ///
    /// ### [`FromSql`] impls
    ///
    /// - [`(Bound<T>, Bound<T>)`][bound] for any `T` which implements `FromSql<ST>`.
    ///
    /// [`ToSql`]: crate::serialize::ToSql
    /// [`FromSql`]: crate::deserialize::FromSql
    /// [bound]: std::collections::Bound
    /// [std::range]: std::ops::Range
    /// [`RangeInclusive<T>`]: std::ops::RangeInclusive
    /// [`RangeFrom<T>`]: std::ops::RangeFrom
    /// [`RangeTo<T>`]: std::ops::RangeTo
    /// [`RangeToInclusive<T>`]: std::ops::RangeToInclusive
    /// [`Range`]: https://www.postgresql.org/docs/current/rangetypes.html
    #[derive(Debug, Clone, Copy, Default, QueryId, SqlType)]
    #[cfg(feature = "postgres_backend")]
    pub struct Range<ST: 'static>(ST);

    #[doc(hidden)]
    pub type Int4range = Range<crate::sql_types::Int4>;
    #[doc(hidden)]
    pub type Int8range = Range<crate::sql_types::Int8>;
    #[doc(hidden)]
    pub type Daterange = Range<crate::sql_types::Date>;
    #[doc(hidden)]

Review comment (suggestion):
Might be worth to point out the syntactic sugar for this
```suggestion
    /// - [`Range<T>`][std::range] (aka `start..end`) for any `T` which implements `ToSql<ST>`.
    /// - [`RangeInclusive<T>`] (aka `start..=end`) for any `T` which implements `ToSql<ST>`.
    /// - [`RangeFrom<T>`] (aka `start..`) for any `T` which implements `ToSql<ST>`.
    /// - [`RangeTo<T>`] (aka `..end`) for any `T` which implements `ToSql<ST>`.
    /// - [`RangeToInclusive<T>`] (aka `..=end`) for any `T` which implements `ToSql<ST>`.
```

Code after:
    ///
    /// ### [`FromSql`] impls
    ///
    /// - [`Vec<T>`][Vec] for any `T` which implements `ToSql<ST>`
    ///
    /// [`ToSql`]: crate::serialize::ToSql
    /// [`FromSql`]: crate::deserialize::FromSql
    /// [Vec]: std::vec::Vec
    /// [slice]: https://doc.rust-lang.org/nightly/std/primitive.slice.html
    /// [`Array`]: https://www.postgresql.org/docs/current/arrays.html
    #[derive(Debug, Clone, Copy, Default, QueryId, SqlType)]
    #[cfg(feature = "postgres_backend")]
    pub struct Array<ST: 'static>(ST);

    /// The [`Range`] SQL type.
    ///
    /// This wraps another type to represent a SQL range of that type.
    ///
    /// ### [`ToSql`] impls
    ///
    /// - [`(Bound<T>, Bound<T>)`][bound] for any `T` which implements `ToSql<ST>`.
    /// - [`Range<T>`][std::range] (aka `start..end`) for any `T` which implements `ToSql<ST>`.
    /// - [`RangeInclusive<T>`] (aka `start..=end`) for any `T` which implements `ToSql<ST>`.
    /// - [`RangeFrom<T>`] (aka `start..`) for any `T` which implements `ToSql<ST>`.
    /// - [`RangeTo<T>`] (aka `..end`) for any `T` which implements `ToSql<ST>`.
    /// - [`RangeToInclusive<T>`] (aka `..=end`) for any `T` which implements `ToSql<ST>`.
    ///
    /// ### [`FromSql`] impls
    ///
    /// - [`(Bound<T>, Bound<T>)`][bound] for any `T` which implements `FromSql<ST>`.
    ///
    /// [`ToSql`]: crate::serialize::ToSql
    /// [`FromSql`]: crate::deserialize::FromSql
    /// [bound]: std::collections::Bound
    /// [std::range]: std::ops::Range
    /// [`RangeInclusive<T>`]: std::ops::RangeInclusive
    /// [`RangeFrom<T>`]: std::ops::RangeFrom
    /// [`RangeTo<T>`]: std::ops::RangeTo
    /// [`RangeToInclusive<T>`]: std::ops::RangeToInclusive
    /// [`Range`]: https://www.postgresql.org/docs/current/rangetypes.html
    #[derive(Debug, Clone, Copy, Default, QueryId, SqlType)]
    #[cfg(feature = "postgres_backend")]
    pub struct Range<ST: 'static>(ST);

    #[doc(hidden)]
    pub type Int4range = Range<crate::sql_types::Int4>;
    #[doc(hidden)]
    pub type Int8range = Range<crate::sql_types::Int8>;
    #[doc(hidden)]
    pub type Daterange = Range<crate::sql_types::Date>;
    #[doc(hidden)]