Derive Debug for Pool

This commit is contained in:
link2xt
2023-02-19 02:18:45 +00:00
parent 75f65b06e8
commit 85517abf58

View File

@@ -1,6 +1,5 @@
//! Connection pool. //! Connection pool.
use std::fmt;
use std::ops::{Deref, DerefMut}; use std::ops::{Deref, DerefMut};
use std::sync::{Arc, Weak}; use std::sync::{Arc, Weak};
@@ -9,6 +8,7 @@ use rusqlite::Connection;
use tokio::sync::Notify; use tokio::sync::Notify;
/// Inner connection pool. /// Inner connection pool.
#[derive(Debug)]
struct InnerPool { struct InnerPool {
/// Available connections. /// Available connections.
connections: ArrayQueue<Connection>, connections: ArrayQueue<Connection>,
@@ -64,18 +64,12 @@ impl DerefMut for PooledConnection {
} }
/// Connection pool. /// Connection pool.
#[derive(Clone)] #[derive(Clone, Debug)]
pub struct Pool { pub struct Pool {
/// Reference to the actual connection pool. /// Reference to the actual connection pool.
inner: Arc<InnerPool>, inner: Arc<InnerPool>,
} }
impl fmt::Debug for Pool {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
write!(fmt, "Pool")
}
}
impl Pool { impl Pool {
/// Creates a new connection pool. /// Creates a new connection pool.
pub fn new(connections: Vec<Connection>) -> Self { pub fn new(connections: Vec<Connection>) -> Self {