Skip to content

Commit 3373559

Browse files
committed
Create debug formatter for SerializedResponse.
1 parent 8091162 commit 3373559

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/lib.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
extern crate core;
1111

1212
use std::collections::{HashMap, HashSet};
13+
#[cfg(test)]
14+
use std::fmt::{Debug, Formatter};
1315
use std::fs::File;
1416
use std::io::BufReader;
1517
use std::ops::Deref;
@@ -118,6 +120,21 @@ impl<L: Deref + Clone + Send + Sync + 'static> RapidSyncProcessor<L> where L::Ta
118120
}
119121
}
120122

123+
#[cfg(test)]
124+
impl Debug for SerializedResponse {
125+
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
126+
write!(
127+
f,
128+
"\nmessages: {}\n\tannouncements: {}\n\tupdates: {}\n\t\tfull: {}\n\t\tincremental: {}",
129+
self.message_count,
130+
self.announcement_count,
131+
self.update_count,
132+
self.update_count_full,
133+
self.update_count_incremental
134+
)
135+
}
136+
}
137+
121138
pub(crate) async fn connect_to_db() -> Client {
122139
let connection_config = config::db_connection_config();
123140
let (client, connection) = connection_config.connect(NoTls).await.unwrap();

0 commit comments

Comments
 (0)