File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change 6161 cargo build --release -p ac-examples --example runtime_update_async --no-default-features,
6262
6363 # Clippy
64- cargo clippy --workspace --exclude test-no-std -- -D warnings,
64+ cargo clippy -- -D warnings,
65+ cargo clippy --no-default-features -- -D warnings,
6566 cargo clippy --all-features --examples -- -D warnings,
6667
6768 # Run tests and build examples
Original file line number Diff line number Diff line change 88
99//! General node-api Error implementation.
1010
11- use alloc:: { string:: String , vec:: Vec } ;
11+ use alloc:: { boxed :: Box , string:: String , vec:: Vec } ;
1212use core:: fmt:: Debug ;
1313use derive_more:: From ;
1414
@@ -40,9 +40,9 @@ pub enum Error {
4040 /// Runtime error.
4141 Runtime ( DispatchError ) ,
4242 /// Error decoding to a [`crate::dynamic::Value`].
43- DecodeValue ( DecodeError ) ,
43+ DecodeValue ( Box < DecodeError > ) ,
4444 /// Error encoding from a [`crate::dynamic::Value`].
45- EncodeValue ( EncodeError ) ,
45+ EncodeValue ( Box < EncodeError > ) ,
4646 /// The bytes representing an error that we were unable to decode.
4747 Unknown ( Vec < u8 > ) ,
4848 /// Other error.
@@ -54,3 +54,15 @@ impl From<&str> for Error {
5454 Error :: Other ( error. into ( ) )
5555 }
5656}
57+
58+ impl From < DecodeError > for Error {
59+ fn from ( error : DecodeError ) -> Self {
60+ Error :: DecodeValue ( Box :: new ( error) )
61+ }
62+ }
63+
64+ impl From < EncodeError > for Error {
65+ fn from ( error : EncodeError ) -> Self {
66+ Error :: EncodeValue ( Box :: new ( error) )
67+ }
68+ }
You can’t perform that action at this time.
0 commit comments