Rlp decode returns Result (#8527)
rlp::decode returns Result Make a best effort to handle decoding errors gracefully throughout the code, using `expect` where the value is guaranteed to be valid (and in other places where it makes sense).
This commit is contained in:
@@ -24,7 +24,7 @@ fn test_encode_foo() {
|
||||
let out = encode(&foo).into_vec();
|
||||
assert_eq!(out, expected);
|
||||
|
||||
let decoded = decode(&expected);
|
||||
let decoded = decode(&expected).expect("decode failure");
|
||||
assert_eq!(foo, decoded);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ fn test_encode_foo_wrapper() {
|
||||
let out = encode(&foo).into_vec();
|
||||
assert_eq!(out, expected);
|
||||
|
||||
let decoded = decode(&expected);
|
||||
let decoded = decode(&expected).expect("decode failure");
|
||||
assert_eq!(foo, decoded);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user