Skip to content

Commit 51cfd77

Browse files
committed
build!: Always implement calls_made
Removes conditional compilation of `ElectrumApi::calls_made`. As a result the `debug-calls` feature flag is also removed.
1 parent ce7a0eb commit 51cfd77

File tree

5 files changed

+0
-14
lines changed

5 files changed

+0
-14
lines changed

.github/workflows/cont_integration.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ jobs:
3636
run: cargo test -- --ignored test_local_timeout
3737
- run: cargo check --verbose --features=use-openssl
3838
- run: cargo check --verbose --no-default-features --features=proxy
39-
- run: cargo check --verbose --no-default-features --features=debug-calls
4039
- run: cargo check --verbose --no-default-features --features=proxy,use-openssl
4140
- run: cargo check --verbose --no-default-features --features=proxy,use-rustls
4241
- run: cargo check --verbose --no-default-features --features=proxy,use-rustls-ring

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ winapi = { version="0.3.9", features=["winsock2"], optional = true }
3939

4040
[features]
4141
default = ["proxy", "rustls"]
42-
debug-calls = []
4342
proxy = ["byteorder", "winapi", "libc"]
4443
rustls = ["webpki-roots", "dep:rustls", "rustls/default"]
4544
rustls-ring = ["webpki-roots", "dep:rustls", "rustls/ring", "rustls/logging", "rustls/std", "rustls/tls12"]

src/api.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ where
176176
(**self).ping()
177177
}
178178

179-
#[cfg(feature = "debug-calls")]
180179
fn calls_made(&self) -> Result<usize, Error> {
181180
(**self).calls_made()
182181
}
@@ -402,7 +401,6 @@ pub trait ElectrumApi {
402401
/// of incoming block header or script notifications.
403402
fn ping(&self) -> Result<(), Error>;
404403

405-
#[cfg(feature = "debug-calls")]
406404
/// Returns the number of network calls made since the creation of the client.
407405
fn calls_made(&self) -> Result<usize, Error>;
408406
}
@@ -611,7 +609,6 @@ mod test {
611609
unreachable!()
612610
}
613611

614-
#[cfg(feature = "debug-calls")]
615612
fn calls_made(&self) -> Result<usize, super::Error> {
616613
unreachable!()
617614
}

src/client.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,6 @@ impl ElectrumApi for Client {
380380
}
381381

382382
#[inline]
383-
#[cfg(feature = "debug-calls")]
384383
fn calls_made(&self) -> Result<usize, Error> {
385384
impl_inner_call!(self, calls_made)
386385
}

src/raw_client.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ where
136136
headers: Mutex<VecDeque<RawHeaderNotification>>,
137137
script_notifications: Mutex<HashMap<ScriptHash, VecDeque<ScriptStatus>>>,
138138

139-
#[cfg(feature = "debug-calls")]
140139
calls: AtomicUsize,
141140
}
142141

@@ -157,7 +156,6 @@ where
157156
headers: Mutex::new(VecDeque::new()),
158157
script_notifications: Mutex::new(HashMap::new()),
159158

160-
#[cfg(feature = "debug-calls")]
161159
calls: AtomicUsize::new(0),
162160
}
163161
}
@@ -741,14 +739,9 @@ impl<S: Read + Write> RawClient<S> {
741739
}
742740

743741
#[inline]
744-
#[cfg(feature = "debug-calls")]
745742
fn increment_calls(&self) {
746743
self.calls.fetch_add(1, Ordering::SeqCst);
747744
}
748-
749-
#[inline]
750-
#[cfg(not(feature = "debug-calls"))]
751-
fn increment_calls(&self) {}
752745
}
753746

754747
impl<T: Read + Write> ElectrumApi for RawClient<T> {
@@ -1169,7 +1162,6 @@ impl<T: Read + Write> ElectrumApi for RawClient<T> {
11691162
Ok(())
11701163
}
11711164

1172-
#[cfg(feature = "debug-calls")]
11731165
fn calls_made(&self) -> Result<usize, Error> {
11741166
Ok(self.calls.load(Ordering::SeqCst))
11751167
}

0 commit comments

Comments
 (0)