Skip to content

Commit

Permalink
Fix the doc comment
Browse files Browse the repository at this point in the history
  • Loading branch information
weiznich committed Aug 24, 2024
1 parent 8c34009 commit 95cbd9e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions diesel/src/pg/expression/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,7 @@ define_sql_function! {

#[cfg(feature = "postgres_backend")]
define_sql_function! {
/// Returns a text representation of the array's dimensions
/// Returns the total number of elements in the array, or 0 if the array is empty.
///
/// # Example
///
Expand All @@ -975,19 +975,19 @@ define_sql_function! {
/// # use diesel::dsl::cardinality;
/// # use diesel::sql_types::{Nullable,Array,Integer};
/// # let connection = &mut establish_connection();
///
///
/// let array_cardinality = diesel::select(cardinality::<Array<Integer>, _>(vec![1, 2, 3, 4]))
/// .get_result::<Option<i32>>(connection)?;
/// assert_eq!(4, array_cardinality.unwrap());
///
///
/// let array_cardinality = diesel::select(cardinality::<Array<Nullable<Integer>>, _>(vec![Some(1), Some(2), Some(3)]))
/// .get_result::<Option<i32>>(connection)?;
/// assert_eq!(3, array_cardinality.unwrap());
///
/// let array_cardinality = diesel::select(cardinality::<Array<Integer>, _>(Vec::<i32>::new()))
/// .get_result::<Option<i32>>(connection)?;
/// assert_eq!(0, array_cardinality.unwrap());
///
///
/// let array_cardinality = diesel::select(cardinality::<Nullable<Array<Integer>>, _>(None::<Vec<i32>>))
/// .get_result::<Option<i32>>(connection)?;
/// assert_eq!(None, array_cardinality);
Expand Down

0 comments on commit 95cbd9e

Please sign in to comment.