mod debug;
mod pretty;
use core::fmt;
pub(crate) use self::debug::DebugPrintSubtreeDescendant;
pub use self::debug::{DebugPrintNodeLocal, DebugPrintSubtree};
pub use self::pretty::DebugPrettyPrint;
#[derive(Clone, Copy, PartialEq, Eq, Hash)]
enum FakeOption {
Some,
None,
}
impl fmt::Debug for FakeOption {
#[inline]
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}
impl FakeOption {
#[inline]
#[must_use]
fn some_if_true(v: bool) -> Self {
if v {
Self::Some
} else {
Self::None
}
}
#[inline]
#[must_use]
fn as_str(&self) -> &'static str {
match self {
Self::Some => "Some(_)",
Self::None => "None",
}
}
}
#[derive(Clone, Copy, PartialEq, Eq, Hash)]
struct RawStr<'a>(&'a str);
impl fmt::Debug for RawStr<'_> {
#[inline]
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.0)
}
}