@@ -71,8 +71,7 @@ fn test_spec_testvectors() {
7171 assert_eq ! (
7272 parsed_instance. label( ) ,
7373 vector. statement,
74- "parsed statement doesn't match original for {}" ,
75- test_name
74+ "parsed statement doesn't match original for {test_name}"
7675 ) ;
7776
7877 // Create NIZK with the session_id from the test vector
@@ -90,8 +89,7 @@ fn test_spec_testvectors() {
9089 assert_eq ! (
9190 computed_iv,
9291 vector. iv. as_slice( ) ,
93- "Computed IV doesn't match test vector IV for {}" ,
94- test_name
92+ "Computed IV doesn't match test vector IV for {test_name}"
9593 ) ;
9694
9795 // Generate proof with the proof generation RNG
@@ -101,70 +99,66 @@ fn test_spec_testvectors() {
10199 // Verify the proof matches
102100 assert_eq ! (
103101 proof_bytes, vector. proof,
104- "proof bytes for test vector {} do not match" ,
105- test_name
102+ "proof bytes for test vector {test_name} do not match"
106103 ) ;
107104
108105 // Verify the proof is valid
109106 let verified = nizk. verify_batchable ( & proof_bytes) . is_ok ( ) ;
110107 assert ! (
111108 verified,
112- "Fiat-Shamir Schnorr proof verification failed for {}" ,
113- test_name
109+ "Fiat-Shamir Schnorr proof verification failed for {test_name}"
114110 ) ;
115111 }
116112}
117113
118114fn extract_vectors_new ( path : & str ) -> Result < HashMap < String , TestVector > , String > {
119115 use std:: collections:: HashMap ;
120116
121- let content =
122- fs:: read_to_string ( path) . map_err ( |e| format ! ( "Unable to read JSON file: {}" , e) ) ?;
123- let root: JsonValue =
124- json:: parse ( & content) . map_err ( |e| format ! ( "JSON parsing error: {}" , e) ) ?;
117+ let content = fs:: read_to_string ( path) . map_err ( |e| format ! ( "Unable to read JSON file: {e}" ) ) ?;
118+ let root: JsonValue = json:: parse ( & content) . map_err ( |e| format ! ( "JSON parsing error: {e}" ) ) ?;
125119
126120 let mut vectors = HashMap :: new ( ) ;
127121
128122 for ( name, obj) in root. entries ( ) {
129123 let ciphersuite = obj[ "Ciphersuite" ]
130124 . as_str ( )
131- . ok_or_else ( || format ! ( "Ciphersuite field not found for {}" , name ) ) ?
125+ . ok_or_else ( || format ! ( "Ciphersuite field not found for {name}" ) ) ?
132126 . to_string ( ) ;
133127
134128 let session_id = Vec :: from_hex (
135129 obj[ "SessionId" ]
136130 . as_str ( )
137- . ok_or_else ( || format ! ( "SessionId field not found for {}" , name ) ) ?,
131+ . ok_or_else ( || format ! ( "SessionId field not found for {name}" ) ) ?,
138132 )
139- . map_err ( |e| format ! ( "Invalid hex in SessionId for {}: {}" , name , e ) ) ?;
133+ . map_err ( |e| format ! ( "Invalid hex in SessionId for {name }: {e}" ) ) ?;
140134
141135 let statement = Vec :: from_hex (
142136 obj[ "Statement" ]
143137 . as_str ( )
144- . ok_or_else ( || format ! ( "Statement field not found for {}" , name ) ) ?,
138+ . ok_or_else ( || format ! ( "Statement field not found for {name}" ) ) ?,
145139 )
146- . map_err ( |e| format ! ( "Invalid hex in Statement for {}: {}" , name , e ) ) ?;
140+ . map_err ( |e| format ! ( "Invalid hex in Statement for {name }: {e}" ) ) ?;
147141
148142 let witness = Vec :: from_hex (
149143 obj[ "Witness" ]
150144 . as_str ( )
151- . ok_or_else ( || format ! ( "Witness field not found for {}" , name ) ) ?,
145+ . ok_or_else ( || format ! ( "Witness field not found for {name}" ) ) ?,
152146 )
153- . map_err ( |e| format ! ( "Invalid hex in Witness for {}: {}" , name , e ) ) ?;
147+ . map_err ( |e| format ! ( "Invalid hex in Witness for {name }: {e}" ) ) ?;
154148
155149 let iv = Vec :: from_hex (
156150 obj[ "IV" ]
157151 . as_str ( )
158- . ok_or_else ( || format ! ( "IV field not found for {}" , name ) ) ?,
152+ . ok_or_else ( || format ! ( "IV field not found for {name}" ) ) ?,
159153 )
160- . map_err ( |e| format ! ( "Invalid hex in IV for {}: {}" , name , e ) ) ?;
154+ . map_err ( |e| format ! ( "Invalid hex in IV for {name }: {e}" ) ) ?;
161155
162156 let proof = Vec :: from_hex (
163157 obj[ "Proof" ]
164158 . as_str ( )
165- . ok_or_else ( || format ! ( "Proof field not found for {}" , name ) ) ?,
159+ . ok_or_else ( || format ! ( "Proof field not found for {name}" ) ) ?,
166160 )
167- . map_err ( |e| format ! ( "Invalid hex in Proof for {}: {}" , name , e ) ) ?;
161+ . map_err ( |e| format ! ( "Invalid hex in Proof for {name }: {e}" ) ) ?;
168162
169163 vectors. insert (
170164 name. to_string ( ) ,
0 commit comments