Skip to content

Commit 77dab97

Browse files
fix: remove DecodeError from trait impls (#79)
* fix: remove DecodeError from trait impls * chore: revert cargo lock
1 parent 0b67dab commit 77dab97

File tree

5 files changed

+3
-32
lines changed

5 files changed

+3
-32
lines changed

pod/src/error.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//! Error types
22
use {
3-
solana_decode_error::DecodeError,
43
solana_msg::msg,
54
solana_program_error::{PrintProgramError, ProgramError},
65
};
@@ -35,11 +34,7 @@ impl<T> solana_decode_error::DecodeError<T> for PodSliceError {
3534
impl PrintProgramError for PodSliceError {
3635
fn print<E>(&self)
3736
where
38-
E: 'static
39-
+ std::error::Error
40-
+ DecodeError<E>
41-
+ PrintProgramError
42-
+ num_traits::FromPrimitive,
37+
E: 'static + std::error::Error + PrintProgramError + num_traits::FromPrimitive,
4338
{
4439
match self {
4540
PodSliceError::CalculationFailure => {

program-error/derive/src/macro_impl.rs

-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ pub fn print_program_error(
104104
where
105105
E: 'static
106106
+ std::error::Error
107-
+ #decode_error_import::DecodeError<E>
108107
+ #program_error_import::PrintProgramError
109108
+ num_traits::FromPrimitive,
110109
{

program-error/tests/bench.rs

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ impl solana_program_error::PrintProgramError for ExampleError {
2828
where
2929
E: 'static
3030
+ std::error::Error
31-
+ solana_decode_error::DecodeError<E>
3231
+ solana_program_error::PrintProgramError
3332
+ num_traits::FromPrimitive,
3433
{

tlv-account-resolution/src/error.rs

+1-12
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//! Error types
22
33
use {
4-
solana_decode_error::DecodeError,
54
solana_msg::msg,
65
solana_program_error::{PrintProgramError, ProgramError},
76
};
@@ -82,20 +81,10 @@ impl From<AccountResolutionError> for ProgramError {
8281
}
8382
}
8483

85-
impl<T> DecodeError<T> for AccountResolutionError {
86-
fn type_of() -> &'static str {
87-
"AccountResolutionError"
88-
}
89-
}
90-
9184
impl PrintProgramError for AccountResolutionError {
9285
fn print<E>(&self)
9386
where
94-
E: 'static
95-
+ std::error::Error
96-
+ DecodeError<E>
97-
+ PrintProgramError
98-
+ num_traits::FromPrimitive,
87+
E: 'static + std::error::Error + PrintProgramError + num_traits::FromPrimitive,
9988
{
10089
match self {
10190
AccountResolutionError::IncorrectAccount => {

type-length-value/src/error.rs

+1-12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//! Error types
22
use {
3-
solana_decode_error::DecodeError,
43
solana_msg::msg,
54
solana_program_error::{PrintProgramError, ProgramError},
65
};
@@ -23,20 +22,10 @@ impl From<TlvError> for ProgramError {
2322
}
2423
}
2524

26-
impl<T> DecodeError<T> for TlvError {
27-
fn type_of() -> &'static str {
28-
"TlvError"
29-
}
30-
}
31-
3225
impl PrintProgramError for TlvError {
3326
fn print<E>(&self)
3427
where
35-
E: 'static
36-
+ std::error::Error
37-
+ DecodeError<E>
38-
+ PrintProgramError
39-
+ num_traits::FromPrimitive,
28+
E: 'static + std::error::Error + PrintProgramError + num_traits::FromPrimitive,
4029
{
4130
match self {
4231
TlvError::TypeNotFound => {

0 commit comments

Comments
 (0)