1
0
Fork 0
forked from wry/wry

autocommit 2022-01-28 03:35:35 CET

This commit is contained in:
Julian Orth 2022-01-28 03:35:35 +01:00
parent c340df0d08
commit a5573b8a3a
36 changed files with 3046 additions and 114 deletions

21
src/utils/debug_fn.rs Normal file
View file

@ -0,0 +1,21 @@
use std::fmt::{Debug, Formatter};
pub fn debug_fn<F>(f: F) -> impl Debug
where
F: Fn(&mut Formatter<'_>) -> std::fmt::Result,
{
DebugFn { f }
}
struct DebugFn<F> {
f: F,
}
impl<F> Debug for DebugFn<F>
where
F: Fn(&mut Formatter<'_>) -> std::fmt::Result,
{
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
(self.f)(f)
}
}