Repository: diesel-rs/diesel
File: diesel/src/pg/expression/expression_methods.rs (Rust)

Code before:
    ///     ])
    ///     .execute(conn)?;
    ///
    /// let data = posts.select(id)
    ///     .filter(versions.lesser_than((Bound::Included(1), Bound::Included(4))))
    ///     .load::<i32>(conn)?;
    /// assert!(data.is_empty());
    ///
    /// let data = posts.select(id)
    ///     .filter(versions.lesser_than((Bound::Included(5), Bound::Included(8))))
    ///     .load::<i32>(conn)?;
    /// assert_eq!(vec![1, 2], data);
    /// #     Ok(())
    /// # }
    /// ```
    fn lesser_than<T>(self, other: T) -> dsl::LesserThanRange<Self, T>
    where
        Self::SqlType: SqlType,
        T: AsExpression<Self::SqlType>,
    {
        Grouped(IsContainedByNet::new(self, other.as_expression()))
    }

    /// Creates a PostgreSQL `>>` expression.
    ///
    /// This operator returns whether two ranges overlap.
    ///
    /// # Example
    ///
    /// ```rust
    /// # include!("../../doctest_setup.rs");
    /// #
    /// # table! {
    /// #     posts {
    /// #         id -> Integer,
    /// #         versions -> Range<Integer>,
    /// #     }
    /// # }
    /// #
    /// # fn main() {
    /// #     run_test().unwrap();
    /// # }
    /// #
    /// # fn run_test() -> QueryResult<()> {
    /// #     use self::posts::dsl::*;
    /// #     use std::collections::Bound;
    /// #     let conn = &mut establish_connection();
    /// #     diesel::sql_query("DROP TABLE IF EXISTS posts").execute(conn).unwrap();
    /// #     diesel::sql_query("CREATE TABLE posts (id SERIAL PRIMARY KEY, versions INT4RANGE NOT NULL)").execute(conn).unwrap();
    /// #
    /// diesel::insert_into(posts)

Review comment (suggestion):
```suggestion
    /// Is the first range strictly right of the second?
```

Code after:
    ///     ])
    ///     .execute(conn)?;
    ///
    /// let data = posts.select(id)
    ///     .filter(versions.lesser_than((Bound::Included(1), Bound::Included(4))))
    ///     .load::<i32>(conn)?;
    /// assert!(data.is_empty());
    ///
    /// let data = posts.select(id)
    ///     .filter(versions.lesser_than((Bound::Included(5), Bound::Included(8))))
    ///     .load::<i32>(conn)?;
    /// assert_eq!(vec![1, 2], data);
    /// #     Ok(())
    /// # }
    /// ```
    fn lesser_than<T>(self, other: T) -> dsl::LesserThanRange<Self, T>
    where
        Self::SqlType: SqlType,
        T: AsExpression<Self::SqlType>,
    {
        Grouped(IsContainedByNet::new(self, other.as_expression()))
    }

    /// Creates a PostgreSQL `>>` expression.
    ///
    /// Is the first range strictly right of the second?
    ///
    /// # Example
    ///
    /// ```rust
    /// # include!("../../doctest_setup.rs");
    /// #
    /// # table! {
    /// #     posts {
    /// #         id -> Integer,
    /// #         versions -> Range<Integer>,
    /// #     }
    /// # }
    /// #
    /// # fn main() {
    /// #     run_test().unwrap();
    /// # }
    /// #
    /// # fn run_test() -> QueryResult<()> {
    /// #     use self::posts::dsl::*;
    /// #     use std::collections::Bound;
    /// #     let conn = &mut establish_connection();
    /// #     diesel::sql_query("DROP TABLE IF EXISTS posts").execute(conn).unwrap();
    /// #     diesel::sql_query("CREATE TABLE posts (id SERIAL PRIMARY KEY, versions INT4RANGE NOT NULL)").execute(conn).unwrap();
    /// #
    /// diesel::insert_into(posts)