use crate::strings::latex::ToLatex;
use crate::strings::typst::ToTypst;
use core::fmt::{Display, Formatter};
use core::iter::{Empty, empty};
use core::str::FromStr;
#[derive(Clone, Copy, Debug, Hash, Eq, Ord, PartialEq, PartialOrd)]
pub enum Never {}
impl Display for Never {
fn fmt(&self, _f: &mut Formatter) -> core::fmt::Result {
unreachable!()
}
}
impl ToLatex for Never {
fn fmt_latex(&self, _f: &mut Formatter) -> core::fmt::Result {
unreachable!()
}
}
impl ToTypst for Never {
fn fmt_typst(&self, _f: &mut Formatter) -> core::fmt::Result {
unreachable!()
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct NeverError;
impl FromStr for Never {
type Err = NeverError;
#[inline]
fn from_str(_: &str) -> Result<Self, NeverError> {
Err(NeverError)
}
}
#[inline]
pub const fn nevers() -> Empty<Never> {
empty()
}