Commit b959029f88

Frank Denis <github@pureftpd.org>
2021-02-28 12:53:27
std/crypto/benchmark: update format strings
Use the s formatter to format strings.
1 parent e65b6d9
Changed files (1)
lib
std
lib/std/crypto/benchmark.zig
@@ -356,63 +356,63 @@ pub fn main() !void {
     inline for (hashes) |H| {
         if (filter == null or std.mem.indexOf(u8, H.name, filter.?) != null) {
             const throughput = try benchmarkHash(H.ty, mode(128 * MiB));
-            try stdout.print("{:>17}: {:10} MiB/s\n", .{ H.name, throughput / (1 * MiB) });
+            try stdout.print("{s:>17}: {:10} MiB/s\n", .{ H.name, throughput / (1 * MiB) });
         }
     }
 
     inline for (macs) |M| {
         if (filter == null or std.mem.indexOf(u8, M.name, filter.?) != null) {
             const throughput = try benchmarkMac(M.ty, mode(128 * MiB));
-            try stdout.print("{:>17}: {:10} MiB/s\n", .{ M.name, throughput / (1 * MiB) });
+            try stdout.print("{s:>17}: {:10} MiB/s\n", .{ M.name, throughput / (1 * MiB) });
         }
     }
 
     inline for (exchanges) |E| {
         if (filter == null or std.mem.indexOf(u8, E.name, filter.?) != null) {
             const throughput = try benchmarkKeyExchange(E.ty, mode(1000));
-            try stdout.print("{:>17}: {:10} exchanges/s\n", .{ E.name, throughput });
+            try stdout.print("{s:>17}: {:10} exchanges/s\n", .{ E.name, throughput });
         }
     }
 
     inline for (signatures) |E| {
         if (filter == null or std.mem.indexOf(u8, E.name, filter.?) != null) {
             const throughput = try benchmarkSignature(E.ty, mode(1000));
-            try stdout.print("{:>17}: {:10} signatures/s\n", .{ E.name, throughput });
+            try stdout.print("{s:>17}: {:10} signatures/s\n", .{ E.name, throughput });
         }
     }
 
     inline for (signature_verifications) |E| {
         if (filter == null or std.mem.indexOf(u8, E.name, filter.?) != null) {
             const throughput = try benchmarkSignatureVerification(E.ty, mode(1000));
-            try stdout.print("{:>17}: {:10} verifications/s\n", .{ E.name, throughput });
+            try stdout.print("{s:>17}: {:10} verifications/s\n", .{ E.name, throughput });
         }
     }
 
     inline for (batch_signature_verifications) |E| {
         if (filter == null or std.mem.indexOf(u8, E.name, filter.?) != null) {
             const throughput = try benchmarkBatchSignatureVerification(E.ty, mode(1000));
-            try stdout.print("{:>17}: {:10} verifications/s (batch)\n", .{ E.name, throughput });
+            try stdout.print("{s:>17}: {:10} verifications/s (batch)\n", .{ E.name, throughput });
         }
     }
 
     inline for (aeads) |E| {
         if (filter == null or std.mem.indexOf(u8, E.name, filter.?) != null) {
             const throughput = try benchmarkAead(E.ty, mode(128 * MiB));
-            try stdout.print("{:>17}: {:10} MiB/s\n", .{ E.name, throughput / (1 * MiB) });
+            try stdout.print("{s:>17}: {:10} MiB/s\n", .{ E.name, throughput / (1 * MiB) });
         }
     }
 
     inline for (aes) |E| {
         if (filter == null or std.mem.indexOf(u8, E.name, filter.?) != null) {
             const throughput = try benchmarkAes(E.ty, mode(100000000));
-            try stdout.print("{:>17}: {:10} ops/s\n", .{ E.name, throughput });
+            try stdout.print("{s:>17}: {:10} ops/s\n", .{ E.name, throughput });
         }
     }
 
     inline for (aes8) |E| {
         if (filter == null or std.mem.indexOf(u8, E.name, filter.?) != null) {
             const throughput = try benchmarkAes8(E.ty, mode(10000000));
-            try stdout.print("{:>17}: {:10} ops/s\n", .{ E.name, throughput });
+            try stdout.print("{s:>17}: {:10} ops/s\n", .{ E.name, throughput });
         }
     }
 }