Skip to content

Commit 6c83940

Browse files
committed
Lift std check to function definition
1 parent cff1b4b commit 6c83940

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lightning-rapid-gossip-sync/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ impl<NG: Deref<Target=NetworkGraph<L>>, L: Deref> RapidGossipSync<NG, L> where L
128128
/// Returns the last sync timestamp to be used the next time rapid sync data is queried.
129129
///
130130
/// `update_data`: `&[u8]` binary stream that comprises the update data
131+
#[cfg(feature = "std")]
131132
pub fn update_network_graph(&self, update_data: &[u8]) -> Result<u32, GraphSyncError> {
132133
let mut read_cursor = io::Cursor::new(update_data);
133134
self.update_network_graph_from_byte_stream(&mut read_cursor)

lightning-rapid-gossip-sync/src/processing.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,14 @@ const MAX_INITIAL_NODE_ID_VECTOR_CAPACITY: u32 = 50_000;
3838
const STALE_RGS_UPDATE_AGE_LIMIT_SECS: u64 = 60 * 60 * 24 * 14;
3939

4040
impl<NG: Deref<Target=NetworkGraph<L>>, L: Deref> RapidGossipSync<NG, L> where L::Target: Logger {
41+
#[cfg(feature = "std")]
4142
pub(crate) fn update_network_graph_from_byte_stream<R: io::Read>(
4243
&self,
4344
read_cursor: &mut R,
4445
) -> Result<u32, GraphSyncError> {
4546
#[allow(unused_mut, unused_assignments)]
4647
let mut current_time_unix = None;
47-
#[cfg(all(feature = "std", not(test)))]
48+
#[cfg(not(test))]
4849
{
4950
// Note that many tests rely on being able to set arbitrarily old timestamps, thus we
5051
// disable this check during tests!

0 commit comments

Comments
 (0)