@@ -189,11 +189,9 @@ impl BatchPriceAttestation {
189
189
bytes. read_exact ( magic_vec. as_mut_slice ( ) ) ?;
190
190
191
191
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
+ ) ;
197
195
}
198
196
199
197
let mut major_version_vec = vec ! [ 0u8 ; mem:: size_of_val( & P2W_FORMAT_VER_MAJOR ) ] ;
@@ -203,8 +201,7 @@ impl BatchPriceAttestation {
203
201
// Major must match exactly
204
202
if major_version != P2W_FORMAT_VER_MAJOR {
205
203
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}"
208
205
)
209
206
. into ( ) ) ;
210
207
}
@@ -216,8 +213,7 @@ impl BatchPriceAttestation {
216
213
// Only older minors are not okay for this codebase
217
214
if minor_version < P2W_FORMAT_VER_MINOR {
218
215
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"
221
217
)
222
218
. into ( ) ) ;
223
219
}
@@ -414,7 +410,7 @@ impl PriceAttestation {
414
410
a if a == PriceStatus :: Halted as u8 => PriceStatus :: Halted ,
415
411
a if a == PriceStatus :: Auction as u8 => PriceStatus :: Auction ,
416
412
other => {
417
- return Err ( format ! ( "Invalid status value {}" , other ) . into ( ) ) ;
413
+ return Err ( format ! ( "Invalid status value {other}" ) . into ( ) ) ;
418
414
}
419
415
} ;
420
416
@@ -513,7 +509,7 @@ mod tests {
513
509
println ! ( "Regular: {:#?}" , & attestation) ;
514
510
println ! ( "Hex: {:#02X?}" , & attestation) ;
515
511
let bytes = attestation. serialize ( ) ;
516
- println ! ( "Hex Bytes: {:02X?}" , bytes ) ;
512
+ println ! ( "Hex Bytes: {bytes :02X?}" ) ;
517
513
518
514
assert_eq ! (
519
515
PriceAttestation :: deserialize( bytes. as_slice( ) ) ?,
@@ -543,10 +539,10 @@ mod tests {
543
539
let batch_attestation = BatchPriceAttestation {
544
540
price_attestations : attestations,
545
541
} ;
546
- println ! ( "Batch hex struct: {:#02X?}" , batch_attestation ) ;
542
+ println ! ( "Batch hex struct: {batch_attestation :#02X?}" ) ;
547
543
548
544
let serialized = batch_attestation. serialize ( ) ?;
549
- println ! ( "Batch hex Bytes: {:02X?}" , serialized ) ;
545
+ println ! ( "Batch hex Bytes: {serialized :02X?}" ) ;
550
546
551
547
let deserialized: BatchPriceAttestation =
552
548
BatchPriceAttestation :: deserialize ( serialized. as_slice ( ) ) ?;
0 commit comments