use std::fmt::{Display, Formatter};
#[non_exhaustive]
#[derive(Clone, Copy)]
pub enum IconMode {
Text,
Icons,
MinimalIcons,
}
pub trait Icon {
fn icon(&self, mode: IconMode) -> &'static str;
}
pub trait Pretty {
fn pretty(&self, f: &mut Formatter<'_>, mode: IconMode) -> std::fmt::Result;
}
pub(crate) fn display(pretty: &dyn Pretty, mode: IconMode) -> impl Display {
std::fmt::from_fn(move |f| pretty.pretty(f, mode))
}