Returns `Ok(ok)` if no errors were added to the builder, otherwise returns a `Result::Err`
(self, ok: T)
| 741 | /// Returns `Ok(ok)` if no errors were added to the builder, |
| 742 | /// otherwise returns a `Result::Err` |
| 743 | pub fn error_or<T>(self, ok: T) -> Result<T, DataFusionError> { |
| 744 | match self.0.len() { |
| 745 | 0 => Ok(ok), |
| 746 | 1 => Err(self.0.into_iter().next().expect("length matched 1")), |
| 747 | _ => Err(DataFusionError::Collection(self.0)), |
| 748 | } |
| 749 | } |
| 750 | } |
| 751 | |
| 752 | /// Unwrap an `Option` if possible. Otherwise return an `DataFusionError::Internal`. |
no test coverage detected