Skip to content

Commit 78d280b

Browse files
committed
chore: move derive_more to dev-deps
1 parent d2757c8 commit 78d280b

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ quick-xml = ["serde?/derive", "serde?/alloc"] # FIXME: quick-xml#473
4646
serde = { version = "1.0", default-features = false, optional = true }
4747
schemars = { version = "0.8", default-features = false, optional = true }
4848
typenum = "1.12.0"
49-
derive_more = { version = "0.99.9", default-features = false }
5049
parity-scale-codec = { version = "3", default-features = false, optional = true }
5150
static_assertions = "1.1.0"
5251
itoa = "1.0.1"
@@ -56,7 +55,7 @@ i256 = { version = "=0.1.1", default-features = false, optional = true }
5655
anyhow = { version = "1.0.38", default-features = false }
5756
colored = "2.0.0"
5857
criterion = "0.5"
59-
derive_more = "0.99.9"
58+
derive_more = { version = "1.0.0", features = ["full"] }
6059
trybuild = "1.0.85"
6160
serde_json = "1"
6261
proptest = "1.0.0"

src/errors.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
use core::fmt::{Display, Formatter, Result};
22

3+
// TODO: once MSRV becomes 1.81, use `core::error::Error` instead.
4+
// Also, enable doctests in CI checks even for no-std.
35
#[cfg(feature = "std")]
4-
use derive_more::Error;
6+
use std::error::Error;
57

68
/// Represents errors during arithmetic operations.
7-
#[cfg_attr(feature = "std", derive(Error))]
89
#[derive(Clone, Debug, PartialEq, Eq)]
910
#[non_exhaustive]
1011
pub enum ArithmeticError {
@@ -34,8 +35,10 @@ impl Display for ArithmeticError {
3435
}
3536
}
3637

38+
#[cfg(feature = "std")]
39+
impl Error for ArithmeticError {}
40+
3741
/// Represents errors during conversions.
38-
#[cfg_attr(feature = "std", derive(Error))]
3942
#[derive(Clone, Debug, PartialEq, Eq)]
4043
pub struct ConvertError {
4144
reason: &'static str,
@@ -57,3 +60,6 @@ impl Display for ConvertError {
5760
f.write_str(self.as_str())
5861
}
5962
}
63+
64+
#[cfg(feature = "std")]
65+
impl Error for ConvertError {}

0 commit comments

Comments
 (0)