@@ -189,11 +189,9 @@ impl BatchPriceAttestation {
189189 bytes. read_exact ( magic_vec. as_mut_slice ( ) ) ?;
190190
191191 if magic_vec. as_slice ( ) != P2W_MAGIC {
192- return Err ( format ! (
193- "Invalid magic {:02X?}, expected {:02X?}" ,
194- magic_vec, P2W_MAGIC ,
195- )
196- . into ( ) ) ;
192+ return Err (
193+ format ! ( "Invalid magic {magic_vec:02X?}, expected {P2W_MAGIC:02X?}" , ) . into ( ) ,
194+ ) ;
197195 }
198196
199197 let mut major_version_vec = vec ! [ 0u8 ; mem:: size_of_val( & P2W_FORMAT_VER_MAJOR ) ] ;
@@ -203,8 +201,7 @@ impl BatchPriceAttestation {
203201 // Major must match exactly
204202 if major_version != P2W_FORMAT_VER_MAJOR {
205203 return Err ( format ! (
206- "Unsupported format major_version {}, expected {}" ,
207- major_version, P2W_FORMAT_VER_MAJOR
204+ "Unsupported format major_version {major_version}, expected {P2W_FORMAT_VER_MAJOR}"
208205 )
209206 . into ( ) ) ;
210207 }
@@ -216,8 +213,7 @@ impl BatchPriceAttestation {
216213 // Only older minors are not okay for this codebase
217214 if minor_version < P2W_FORMAT_VER_MINOR {
218215 return Err ( format ! (
219- "Unsupported format minor_version {}, expected {} or more" ,
220- minor_version, P2W_FORMAT_VER_MINOR
216+ "Unsupported format minor_version {minor_version}, expected {P2W_FORMAT_VER_MINOR} or more"
221217 )
222218 . into ( ) ) ;
223219 }
@@ -414,7 +410,7 @@ impl PriceAttestation {
414410 a if a == PriceStatus :: Halted as u8 => PriceStatus :: Halted ,
415411 a if a == PriceStatus :: Auction as u8 => PriceStatus :: Auction ,
416412 other => {
417- return Err ( format ! ( "Invalid status value {}" , other ) . into ( ) ) ;
413+ return Err ( format ! ( "Invalid status value {other}" ) . into ( ) ) ;
418414 }
419415 } ;
420416
@@ -513,7 +509,7 @@ mod tests {
513509 println ! ( "Regular: {:#?}" , & attestation) ;
514510 println ! ( "Hex: {:#02X?}" , & attestation) ;
515511 let bytes = attestation. serialize ( ) ;
516- println ! ( "Hex Bytes: {:02X?}" , bytes ) ;
512+ println ! ( "Hex Bytes: {bytes :02X?}" ) ;
517513
518514 assert_eq ! (
519515 PriceAttestation :: deserialize( bytes. as_slice( ) ) ?,
@@ -543,10 +539,10 @@ mod tests {
543539 let batch_attestation = BatchPriceAttestation {
544540 price_attestations : attestations,
545541 } ;
546- println ! ( "Batch hex struct: {:#02X?}" , batch_attestation ) ;
542+ println ! ( "Batch hex struct: {batch_attestation :#02X?}" ) ;
547543
548544 let serialized = batch_attestation. serialize ( ) ?;
549- println ! ( "Batch hex Bytes: {:02X?}" , serialized ) ;
545+ println ! ( "Batch hex Bytes: {serialized :02X?}" ) ;
550546
551547 let deserialized: BatchPriceAttestation =
552548 BatchPriceAttestation :: deserialize ( serialized. as_slice ( ) ) ?;
0 commit comments