File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ impl<'a> HexIterator<'a> {
8686 ///
8787 /// If the input string is of odd length.
8888 pub fn new ( s : & ' a str ) -> Result < HexIterator < ' a > , Error > {
89- if s. len ( ) % 2 != 0 {
89+ if ! s. len ( ) . is_multiple_of ( 2 ) {
9090 Err ( Error :: OddLengthString ( s. len ( ) ) )
9191 } else {
9292 Ok ( HexIterator {
Original file line number Diff line number Diff line change @@ -404,7 +404,7 @@ impl HashEngine {
404404 ///
405405 /// If `length` is not a multiple of the block size.
406406 pub fn from_midstate ( midstate : Midstate , length : usize ) -> HashEngine {
407- assert ! ( length % BLOCK_SIZE == 0 , "length is no multiple of the block size" ) ;
407+ assert ! ( length. is_multiple_of ( BLOCK_SIZE ) , "length is no multiple of the block size" ) ;
408408
409409 let mut ret = [ 0 ; 8 ] ;
410410 for ( ret_val, midstate_bytes) in ret. iter_mut ( ) . zip ( midstate[ ..] . chunks_exact ( 4 ) ) {
You can’t perform that action at this time.
0 commit comments