Skip to content

Commit 80f7db3

Browse files
committed
Revert back to std::error::Error
Fixes compile error on Rust 1.75.0 since `core::error` is only available after 1.81.0.
1 parent fbb3a99 commit 80f7db3

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/client.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ impl Client {
4343
) -> Result<T, Error>
4444
where
4545
T: for<'de> Deserialize<'de>,
46-
E: core::error::Error + Send + Sync + 'static,
46+
E: std::error::Error + Send + Sync + 'static,
4747
{
4848
let method = rpc.method();
4949
let raw_value = if params.is_empty() {
@@ -69,7 +69,7 @@ impl Client {
6969
) -> Result<T, Error>
7070
where
7171
T: for<'de> Deserialize<'de>,
72-
E: core::error::Error + Send + Sync + 'static,
72+
E: std::error::Error + Send + Sync + 'static,
7373
{
7474
let method = rpc.method();
7575
let raw_value = if params.is_empty() {

src/error.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub enum Error {
2121
/// JSON-RPC error from the server.
2222
JsonRpc(jsonrpc::Error),
2323
/// model types error
24-
Model(Box<dyn core::error::Error + Send + Sync>),
24+
Model(Box<dyn std::error::Error + Send + Sync>),
2525
/// nonce mismatch
2626
NonceMismatch,
2727
/// integer conversion
@@ -43,22 +43,22 @@ impl fmt::Display for Error {
4343
}
4444
}
4545

46-
impl core::error::Error for Error {}
46+
impl std::error::Error for Error {}
4747

4848
impl Error {
4949
/// Convert `e` to a [`Error::Model`] error.
5050
#[cfg(feature = "bitreq")]
5151
pub(crate) fn model<E>(e: E) -> Self
5252
where
53-
E: core::error::Error + Send + Sync + 'static,
53+
E: std::error::Error + Send + Sync + 'static,
5454
{
5555
Self::Model(Box::new(e))
5656
}
5757

5858
/// Convert `e` to a [`jsonrpc::Error::Transport`] error.
5959
pub(crate) fn transport<E>(e: E) -> Self
6060
where
61-
E: core::error::Error + Send + Sync + 'static,
61+
E: std::error::Error + Send + Sync + 'static,
6262
{
6363
Self::JsonRpc(jsonrpc::Error::Transport(Box::new(e)))
6464
}

0 commit comments

Comments
 (0)