either_or_both/error.rs
1//! The crate's error
2
3use core::fmt::Display;
4
5#[derive(Debug, PartialEq, Eq, Clone, Copy)]
6/// The error if converting from a 2-tuple of `Options` to [`crate::EitherOrBoth`] fails
7pub struct TryFromOptionsError;
8
9impl Display for TryFromOptionsError {
10 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
11 write!(f, "Either the left, right or both values must be present")
12 }
13}
14
15#[cfg(feature = "std")]
16impl std::error::Error for TryFromOptionsError {}