File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -253,10 +253,10 @@ impl MockApi {
253
253
254
254
/// Does basic validation of the number of bytes in a canonical address
255
255
fn validate_length ( bytes : & [ u8 ] ) -> StdResult < ( ) > {
256
- if !( 1 ..=255 ) . contains ( & bytes. len ( ) ) {
257
- return Err ( StdError :: generic_err ( "Invalid canonical address length" ) ) ;
256
+ match bytes. len ( ) {
257
+ 1 ..=255 => Ok ( ( ) ) ,
258
+ _ => Err ( StdError :: generic_err ( "Invalid canonical address length" ) ) ,
258
259
}
259
- Ok ( ( ) )
260
260
}
261
261
262
262
/// Returns a default enviroment with height, time, chain_id, and contract address
Original file line number Diff line number Diff line change @@ -162,10 +162,10 @@ impl BackendApi for MockApi {
162
162
163
163
/// Does basic validation of the number of bytes in a canonical address
164
164
fn validate_length ( bytes : & [ u8 ] ) -> Result < ( ) , BackendError > {
165
- if !( 1 ..=255 ) . contains ( & bytes. len ( ) ) {
166
- return Err ( BackendError :: user_err ( "Invalid canonical address length" ) ) ;
165
+ match bytes. len ( ) {
166
+ 1 ..=255 => Ok ( ( ) ) ,
167
+ _ => Err ( BackendError :: user_err ( "Invalid canonical address length" ) ) ,
167
168
}
168
- Ok ( ( ) )
169
169
}
170
170
171
171
/// Returns a default enviroment with height, time, chain_id, and contract address
You can’t perform that action at this time.
0 commit comments