Fixing calls_made fn signature

This commit is contained in:
Dr Maxim Orlovsky 2021-01-21 00:53:36 +01:00
parent aacb1291a5
commit 7d7a3088e6
No known key found for this signature in database
GPG Key ID: FFC0250947E5C6F7
3 changed files with 4 additions and 4 deletions

View File

@ -183,5 +183,5 @@ pub trait ElectrumApi {
#[cfg(feature = "debug-calls")]
/// Returns the number of network calls made since the creation of the client.
fn calls_made(&self) -> usize;
fn calls_made(&self) -> Result<usize, Error>;
}

View File

@ -285,7 +285,7 @@ impl ElectrumApi for Client {
#[inline]
#[cfg(feature = "debug-calls")]
fn calls_made(&self) -> usize {
fn calls_made(&self) -> Result<usize, Error> {
impl_inner_call!(self, calls_made)
}
}

View File

@ -984,8 +984,8 @@ impl<T: Read + Write> ElectrumApi for RawClient<T> {
}
#[cfg(feature = "debug-calls")]
fn calls_made(&self) -> usize {
self.calls.load(Ordering::SeqCst)
fn calls_made(&self) -> Result<usize, Error> {
Ok(self.calls.load(Ordering::SeqCst))
}
}