authorgravatar for 124872+jedisct1@users.noreply.github.comFrank Denis <124872+jedisct1@users.noreply.github.com> 2026-05-03 17:29:03+02:00
committergravatar for 124872+jedisct1@users.noreply.github.comFrank Denis <124872+jedisct1@users.noreply.github.com> 2026-05-28 16:28:27+02:00
log87e0dc7dea6153d7b34c3b8d626316ca7d5ce787
tree66a142ac90c9a230ea1d57f580379b34aa73fecb
parent3f1dead2fc5922b588fbfb108f421ca957d6934a

std.crypto.codecs.asn1.Oid: align toDot with the new Writer API

Take a *std.Io.Writer instead of an anytype writer, and read the test output via stream.buffered() now that .written() is gone.

1 files changed, 2 insertions(+), 2 deletions(-)

lib/std/crypto/codecs/asn1/Oid.zig+2-2
...@@ -47,7 +47,7 @@ test fromDot {...@@ -47,7 +47,7 @@ test fromDot {
47 }47 }
48}48}
4949
50pub fn toDot(self: Oid, writer: anytype) @TypeOf(writer).Error!void {50pub fn toDot(self: Oid, writer: *std.Io.Writer) std.Io.Writer.Error!void {
51 const encoded = self.encoded;51 const encoded = self.encoded;
52 const first = @divTrunc(encoded[0], 40);52 const first = @divTrunc(encoded[0], 40);
53 const second = encoded[0] - first * 40;53 const second = encoded[0] - first * 40;
...@@ -81,7 +81,7 @@ test toDot {...@@ -81,7 +81,7 @@ test toDot {
81 for (test_cases) |t| {81 for (test_cases) |t| {
82 var stream: std.Io.Writer = .fixed(&buf);82 var stream: std.Io.Writer = .fixed(&buf);
83 try toDot(Oid{ .encoded = t.encoded }, &stream);83 try toDot(Oid{ .encoded = t.encoded }, &stream);
84 try std.testing.expectEqualStrings(t.dot_notation, stream.written());84 try std.testing.expectEqualStrings(t.dot_notation, stream.buffered());
85 }85 }
86}86}
8787