/
germanubis
/
sqlx
Обзор
Документация
Войти
/
germanubis
/
sqlx
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
sqlx-core/src/common/mod.rs
28 строк
647 B
Austin Bonander
Break drivers out into separate crates, clean up some technical debt (#2039)
22 фев 2023, 00:25
22 фев 2023, 00:25
b5312c3
Код
Авторство
О чём код?
mod statement_cache; pub use statement_cache::StatementCache; use std::fmt::{Debug, Formatter}; use std::ops::{Deref, DerefMut}; /// A wrapper for `Fn`s that provides a debug impl that just says "Function" pub struct DebugFn<F: ?Sized>(pub F); impl<F: ?Sized> Deref for DebugFn<F> { type Target = F; fn deref(&self) -> &Self::Target { &self.0 } } impl<F: ?Sized> DerefMut for DebugFn<F> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0 } } impl<F: ?Sized> Debug for DebugFn<F> { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { f.debug_tuple("Function").finish() } }