@@ -95,8 +95,8 @@ mod tests {
9595
9696 #[ test]
9797 fn test_hash_contains_preset_params ( ) {
98- let hash = argon2id_hash ( "test" . into ( ) , Argon2Preset :: Mobile )
99- . expect ( "hashing should succeed" ) ;
98+ let hash =
99+ argon2id_hash ( "test" . into ( ) , Argon2Preset :: Mobile ) . expect ( "hashing should succeed" ) ;
100100
101101 // Mobile: m=65536 (64*1024), t=3, p=4
102102 assert ! ( hash. contains( "m=65536" ) , "Missing memory param: {}" , hash) ;
@@ -106,8 +106,8 @@ mod tests {
106106
107107 #[ test]
108108 fn test_hash_desktop_preset_params ( ) {
109- let hash = argon2id_hash ( "test" . into ( ) , Argon2Preset :: Desktop )
110- . expect ( "hashing should succeed" ) ;
109+ let hash =
110+ argon2id_hash ( "test" . into ( ) , Argon2Preset :: Desktop ) . expect ( "hashing should succeed" ) ;
111111
112112 // Desktop: m=262144 (256*1024), t=4, p=8
113113 assert ! ( hash. contains( "m=262144" ) , "Missing memory param: {}" , hash) ;
@@ -147,7 +147,10 @@ mod tests {
147147 let hash2 = argon2id_hash_with_salt ( "password" . into ( ) , salt. into ( ) , Argon2Preset :: Mobile )
148148 . expect ( "hashing should succeed" ) ;
149149
150- assert_eq ! ( hash1, hash2, "Same password + salt should produce same hash" ) ;
150+ assert_eq ! (
151+ hash1, hash2,
152+ "Same password + salt should produce same hash"
153+ ) ;
151154 }
152155
153156 #[ test]
@@ -159,7 +162,10 @@ mod tests {
159162 let hash2 = argon2id_hash_with_salt ( "password2" . into ( ) , salt. into ( ) , Argon2Preset :: Mobile )
160163 . expect ( "hashing should succeed" ) ;
161164
162- assert_ne ! ( hash1, hash2, "Different passwords should produce different hashes" ) ;
165+ assert_ne ! (
166+ hash1, hash2,
167+ "Different passwords should produce different hashes"
168+ ) ;
163169 }
164170
165171 #[ test]
@@ -196,7 +202,11 @@ mod tests {
196202
197203 #[ test]
198204 fn test_invalid_salt ( ) {
199- let result = argon2id_hash_with_salt ( "password" . into ( ) , "!!!invalid!!!" . into ( ) , Argon2Preset :: Mobile ) ;
205+ let result = argon2id_hash_with_salt (
206+ "password" . into ( ) ,
207+ "!!!invalid!!!" . into ( ) ,
208+ Argon2Preset :: Mobile ,
209+ ) ;
200210 assert ! ( result. is_err( ) ) ;
201211 match result {
202212 Err ( CryptoError :: InvalidParameter ( _) ) => { } // expected
@@ -207,8 +217,8 @@ mod tests {
207217 #[ test]
208218 fn test_empty_password_hashes ( ) {
209219 // Empty password is valid — Argon2id should handle it
210- let hash = argon2id_hash ( String :: new ( ) , Argon2Preset :: Mobile )
211- . expect ( "empty password should hash" ) ;
220+ let hash =
221+ argon2id_hash ( String :: new ( ) , Argon2Preset :: Mobile ) . expect ( "empty password should hash" ) ;
212222 assert ! ( hash. starts_with( "$argon2id$" ) ) ;
213223 assert ! ( argon2id_verify( hash, String :: new( ) ) . is_ok( ) ) ;
214224 }
0 commit comments