onenote_parser 2.0.0

A parser for Microsoft OneNoteĀ® files
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/// A pass-through value with a fixed `Debug` representation.
///
/// `f.debug_map().entry(k, v)` always formats `v` via `Debug`, which adds
/// quotes / escapes when `v` is a `String`. Use `DebugOutput` to substitute
/// already-formatted text without those decorations.
pub(crate) struct DebugOutput<'a>(&'a str);

impl<'a> From<&'a str> for DebugOutput<'a> {
    fn from(value: &'a str) -> Self {
        Self(value)
    }
}

impl std::fmt::Debug for DebugOutput<'_> {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        f.write_str(self.0)
    }
}