Function datafusion_optimizer::utils::only_or_err

source ·
pub fn only_or_err<T>(slice: &[T]) -> Result<&T>
👎Deprecated since 34.0.0: use datafusion_expr::utils::only_or_err instead
Expand description

Returns the first (and only) element in a slice, or an error

§Arguments

  • slice - The slice to extract from

§Return value

The first element, or an error