authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-09-18 17:47:30-07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-09-18 17:47:30-07:00
log3243df204ed02f0423884193885e5ad5621ba301
treea5094938ca9bafbe733063b65700b935cf058d69
parent786d9e1b55cc75d6e11ad5077e96efc425316512
signature Signed by SSH key SHA256:4hHJbtBRU58AYXwjL7fkz2fnQHdiye8x1QpTCQ0sHNw

HashWriter: add from init


1 files changed, 5 insertions(+), 0 deletions(-)

hash_writer.zig+5
......@@ -3,6 +3,7 @@
33const std = @import("std");
44const nio = @import("./nio.zig");
55const builtin = @import("builtin");
6const extras = @import("extras");
67
78const sys = switch (builtin.target.os.tag) {
89 .linux => @import("sys-linux"),
......@@ -23,6 +24,10 @@ pub fn HashWriter(comptime Hash: type) type {
2324 };
2425 }
2526
27 pub fn from(hasher: anytype) HashWriter(extras.Pointee(@TypeOf(hasher))) {
28 return .init(hasher);
29 }
30
2631 const W = nio.Writable(@This(), ._const);
2732 pub const writeAll = W.writeAll;
2833 pub const writevAll = W.writevAll;