| 1 | mod statement_cache; |
| 2 | |
| 3 | pub use statement_cache::StatementCache; |
| 4 | use std::fmt::{Debug, Formatter}; |
| 5 | use std::ops::{Deref, DerefMut}; |
| 6 | |
| 7 | /// A wrapper for `Fn`s that provides a debug impl that just says "Function" |
| 8 | pub struct DebugFn<F: ?Sized>(pub F); |
| 9 | |
| 10 | impl<F: ?Sized> Deref for DebugFn<F> { |
| 11 | type Target = F; |
| 12 | |
| 13 | fn deref(&self) -> &Self::Target { |
| 14 | &self.0 |
| 15 | } |
| 16 | } |
| 17 | |
| 18 | impl<F: ?Sized> DerefMut for DebugFn<F> { |
| 19 | fn deref_mut(&mut self) -> &mut Self::Target { |
| 20 | &mut self.0 |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | impl<F: ?Sized> Debug for DebugFn<F> { |
| 25 | fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { |
| 26 | f.debug_tuple("Function").finish() |
| 27 | } |
| 28 | } |