Skip to content

Commit

Permalink
fix: fix array_remove return type
Browse files Browse the repository at this point in the history
  • Loading branch information
edwinlzs committed Aug 21, 2024
1 parent 4a82f04 commit 1ce88e1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions diesel/src/pg/expression/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -805,18 +805,18 @@ define_sql_function! {
/// # use diesel::sql_types::{Nullable, Integer, Array};
/// # let connection = &mut establish_connection();
/// let ints = diesel::select(array_remove::<Array<_>, Integer, _, _>(vec![1, 2, 3, 2], 2))
/// .get_result::<Option<Vec<i32>>>(connection)?;
/// assert_eq!(Some(vec![1, 3]), ints);
/// .get_result::<Vec<i32>>(connection)?;
/// assert_eq!(vec![1, 3], ints);
///
/// let ints = diesel::select(array_remove::<Array<_>, Nullable<Integer>, _, _>(vec![None, Some(1), Some(2), None, Some(4)], None::<i32>))
/// .get_result::<Option<Vec<Option<i32>>>>(connection)?;
/// assert_eq!(Some(vec![Some(1), Some(2), Some(4)]), ints);
/// .get_result::<Vec<Option<i32>>>(connection)?;
/// assert_eq!(vec![Some(1), Some(2), Some(4)], ints);
///
/// let ints = diesel::select(array_remove::<Nullable<Array<_>>, Nullable<Integer>, _, _>(None::<Vec<i32>>, None::<i32>))
/// .get_result::<Option<Vec<Option<i32>>>>(connection)?;
/// assert_eq!(None, ints);
/// # Ok(())
/// # }
/// ```
fn array_remove<Arr: ArrayOrNullableArray<Inner=T> + SingleValue, T: SingleValue>(a: Arr, e: T) -> Nullable<Array<T>>;
fn array_remove<Arr: ArrayOrNullableArray<Inner=T> + SingleValue, T: SingleValue>(a: Arr, e: T) -> Arr;
}

0 comments on commit 1ce88e1

Please sign in to comment.