Skip to content

Commit

Permalink
doctest fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Ali Tariq authored and Ali Tariq committed Aug 22, 2024
1 parent bf30144 commit f7a7f62
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions diesel/src/pg/expression/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -766,16 +766,16 @@ define_sql_function! {
/// # use diesel::sql_types::{Nullable,Array,Integer};
/// # let connection = &mut establish_connection();
///
/// let dims = diesel::select(array_dims::<Array<_>,_>(vec![1,2]))
/// let dims = diesel::select(array_dims::<Array<_>,_,_>(vec![1,2]))
/// .get_result::<String>(connection).unwrap();
/// assert!(String::from("[1:2]").eq(&dims));
///
/// let dims = diesel::select(array_dims::<Array<_>,_>(vec![vec![1,2,3],vec![4,5,6]]))
/// let dims = diesel::select(array_dims::<Array<_>,_,_>(vec![vec![1,2,3],vec![4,5,6]]))
/// .get_result::<String>(connection).unwrap();
/// assert!(String::from("[1:2][1:3]").eq(&dims));
///
/// # Ok(())
/// # }
///
fn array_dims<Arr:ArrayOrNullableArray + SingleValue>(arr:Arr) -> Text;
fn array_dims<Arr:ArrayOrNullableArray<Inner=T> + SingleValue,T:SingleValue>(arr:Arr) -> Text;
}
2 changes: 1 addition & 1 deletion diesel/src/pg/expression/helper_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -356,4 +356,4 @@ pub type array_append<A, E> = super::functions::array_append<SqlTypeOf<A>, SqlTy
/// Return type of [`array_dims(array)`](super::functions::array_append())
#[allow(non_camel_case_types)]
#[cfg(feature = "postgres_backend")]
pub type array_dims<A> = super::functions::array_dims<SqlTypeOf<A>, A>;
pub type array_dims<A,T> = super::functions::array_dims<SqlTypeOf<A>,SqlTypeOf<T>, A>;

0 comments on commit f7a7f62

Please sign in to comment.