tinc/private/
fmt.rs

1pub struct FuncFmt<F: Fn(&mut std::fmt::Formatter) -> std::fmt::Result>(pub F);
2
3impl<F> std::fmt::Display for FuncFmt<F>
4where
5    F: Fn(&mut std::fmt::Formatter) -> std::fmt::Result,
6{
7    #[inline(always)]
8    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9        (self.0)(f)
10    }
11}
12impl<F> std::fmt::Debug for FuncFmt<F>
13where
14    F: Fn(&mut std::fmt::Formatter) -> std::fmt::Result,
15{
16    #[inline(always)]
17    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18        (self.0)(f)
19    }
20}