use super::{super::annotate::*, macros::*};
use {
depiction::*,
std::{fmt, io},
};
impl_normal! {
Boolean(bool)
}
impl_normal_basic!(Boolean);
impl<AnnotatedT> Depict for Boolean<AnnotatedT> {
fn depict<WriteT>(&self, writer: &mut WriteT, context: &DepictionContext) -> io::Result<()>
where
WriteT: io::Write,
{
context.separate(writer)?;
context.theme.write_symbol(writer, self.inner)
}
}
impl<AnnotatedT> fmt::Display for Boolean<AnnotatedT> {
fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt::Display::fmt(&self.inner, formatter)
}
}
impl<AnnotatedT> From<&Boolean<AnnotatedT>> for bool {
fn from(boolean: &Boolean<AnnotatedT>) -> Self {
boolean.inner
}
}