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