From 8b656bad5f4ead969a682ea902fdc1013cb71a16 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Thu, 22 Jul 2021 16:30:57 +0300 Subject: [PATCH] Add a missing [cfg(test)] We don't always need to compile tests. --- walkeeper/src/replication.rs | 7 +++++-- zenith_utils/src/pq_proto.rs | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/walkeeper/src/replication.rs b/walkeeper/src/replication.rs index baf8962ee1..be9e1c094f 100644 --- a/walkeeper/src/replication.rs +++ b/walkeeper/src/replication.rs @@ -229,14 +229,17 @@ impl ReplicationConn { } } +#[cfg(test)] mod tests { + use super::*; + // A no-op impl for tests - impl super::HsFeedbackSubscriber for () {} + impl HsFeedbackSubscriber for () {} #[test] fn test_replication_conn_background_thread_eof() { // Test that background_thread recognizes EOF let stream: &[u8] = &[]; - super::ReplicationConn::background_thread(stream, ()).unwrap(); + ReplicationConn::background_thread(stream, ()).unwrap(); } } diff --git a/zenith_utils/src/pq_proto.rs b/zenith_utils/src/pq_proto.rs index 3e7165ab60..3a9b41859e 100644 --- a/zenith_utils/src/pq_proto.rs +++ b/zenith_utils/src/pq_proto.rs @@ -88,9 +88,11 @@ impl FeMessage { /// ``` /// # use std::io::Read; /// # use zenith_utils::pq_proto::FeMessage; + /// # /// # fn process_message(msg: FeMessage) -> anyhow::Result<()> { /// # Ok(()) /// # }; + /// # /// fn do_the_job(stream: &mut impl Read) -> anyhow::Result<()> { /// while let Some(msg) = FeMessage::read(stream)? { /// process_message(msg)?;