File tree Expand file tree Collapse file tree 1 file changed +1
-8
lines changed Expand file tree Collapse file tree 1 file changed +1
-8
lines changed Original file line number Diff line number Diff line change @@ -492,10 +492,6 @@ impl Message {
492
492
/// [secure signature](https://twitter.com/pwuille/status/1063582706288586752).
493
493
#[ inline]
494
494
pub fn from_slice ( data : & [ u8 ] ) -> Result < Message , Error > {
495
- if data == [ 0 ; constants:: MESSAGE_SIZE ] {
496
- return Err ( Error :: InvalidMessage ) ;
497
- }
498
-
499
495
match data. len ( ) {
500
496
constants:: MESSAGE_SIZE => {
501
497
let mut ret = [ 0 ; constants:: MESSAGE_SIZE ] ;
@@ -1087,10 +1083,7 @@ mod tests {
1087
1083
Err ( InvalidMessage ) ) ;
1088
1084
assert_eq ! ( Message :: from_slice( & [ 0 ; constants:: MESSAGE_SIZE + 1 ] ) ,
1089
1085
Err ( InvalidMessage ) ) ;
1090
- assert_eq ! (
1091
- Message :: from_slice( & [ 0 ; constants:: MESSAGE_SIZE ] ) ,
1092
- Err ( InvalidMessage )
1093
- ) ;
1086
+ assert ! ( Message :: from_slice( & [ 0 ; constants:: MESSAGE_SIZE ] ) . is_ok( ) ) ;
1094
1087
assert ! ( Message :: from_slice( & [ 1 ; constants:: MESSAGE_SIZE ] ) . is_ok( ) ) ;
1095
1088
}
1096
1089
You can’t perform that action at this time.
0 commit comments