Skip to content

Commit e7eeb6c

Browse files
committed
remove unnecessary impl error:Error impl from lib
1 parent 22c3743 commit e7eeb6c

File tree

7 files changed

+5
-50
lines changed

7 files changed

+5
-50
lines changed

src/descriptor/mod.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -268,15 +268,7 @@ impl fmt::Display for DescriptorKeyParseError {
268268
}
269269
}
270270

271-
impl error::Error for DescriptorKeyParseError {
272-
fn description(&self) -> &str {
273-
""
274-
}
275-
276-
fn cause(&self) -> Option<&error::Error> {
277-
None
278-
}
279-
}
271+
impl error::Error for DescriptorKeyParseError {}
280272

281273
impl fmt::Display for DescriptorPublicKey {
282274
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {

src/interpreter/error.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,6 @@ impl From<::Error> for Error {
101101
}
102102

103103
impl error::Error for Error {
104-
fn description(&self) -> &str {
105-
""
106-
}
107104
fn cause(&self) -> Option<&error::Error> {
108105
match *self {
109106
Error::Secp(ref err) => Some(err),

src/lib.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -428,10 +428,6 @@ impl error::Error for Error {
428428
_ => None,
429429
}
430430
}
431-
432-
fn description(&self) -> &str {
433-
""
434-
}
435431
}
436432

437433
// https://github.com/sipa/miniscript/pull/5 for discussion on this number

src/miniscript/analyzable.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,7 @@ impl fmt::Display for AnalysisError {
6565
}
6666
}
6767

68-
impl error::Error for AnalysisError {
69-
fn description(&self) -> &str {
70-
""
71-
}
72-
fn cause(&self) -> Option<&error::Error> {
73-
None
74-
}
75-
}
68+
impl error::Error for AnalysisError {}
7669

7770
impl<Pk: MiniscriptKey, Ctx: ScriptContext> Miniscript<Pk, Ctx> {
7871
/// Whether all spend paths of miniscript require a signature

src/policy/compiler.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,7 @@ pub enum CompilerError {
6262
PolicyError(policy::concrete::PolicyError),
6363
}
6464

65-
impl error::Error for CompilerError {
66-
fn cause(&self) -> Option<&error::Error> {
67-
None
68-
}
69-
70-
fn description(&self) -> &str {
71-
""
72-
}
73-
}
65+
impl error::Error for CompilerError {}
7466

7567
impl fmt::Display for CompilerError {
7668
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {

src/policy/concrete.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,7 @@ pub enum PolicyError {
9393
DuplicatePubKeys,
9494
}
9595

96-
impl error::Error for PolicyError {
97-
fn description(&self) -> &str {
98-
""
99-
}
100-
fn cause(&self) -> Option<&error::Error> {
101-
None
102-
}
103-
}
96+
impl error::Error for PolicyError {}
10497

10598
impl fmt::Display for PolicyError {
10699
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {

src/psbt/mod.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -183,15 +183,7 @@ impl From<bitcoin::util::key::Error> for InputError {
183183
}
184184
}
185185

186-
impl error::Error for Error {
187-
fn cause(&self) -> Option<&error::Error> {
188-
None
189-
}
190-
191-
fn description(&self) -> &str {
192-
""
193-
}
194-
}
186+
impl error::Error for Error {}
195187

196188
impl fmt::Display for Error {
197189
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {

0 commit comments

Comments
 (0)