Skip to content

Commit 1dc96cb

Browse files
committed
Always check next_route in TestRouter is fully consumed
...rather than only in std.
1 parent 6090d9e commit 1dc96cb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lightning/src/util/test_utils.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,12 @@ impl<'a> Router for TestRouter<'a> {
114114
fn notify_payment_probe_failed(&self, _path: &[&RouteHop], _short_channel_id: u64) {}
115115
}
116116

117-
#[cfg(feature = "std")] // If we put this on the `if`, we get "attributes are not yet allowed on `if` expressions" on 1.41.1
118117
impl<'a> Drop for TestRouter<'a> {
119118
fn drop(&mut self) {
120-
if std::thread::panicking() {
121-
return;
119+
#[cfg(feature = "std")] {
120+
if std::thread::panicking() {
121+
return;
122+
}
122123
}
123124
assert!(self.next_routes.lock().unwrap().is_empty());
124125
}

0 commit comments

Comments
 (0)