From 8b47802e383dde95650f9d24e88c2f67f6596a98 Mon Sep 17 00:00:00 2001 From: Martin Ashby Date: Thu, 1 Feb 2024 14:39:26 +0000 Subject: Update for zig master --- comments/src/main.zig | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) (limited to 'comments/src') diff --git a/comments/src/main.zig b/comments/src/main.zig index 8710d95..ac8193e 100644 --- a/comments/src/main.zig +++ b/comments/src/main.zig @@ -7,33 +7,34 @@ const smtp = @import("smtp"); const Params = zws.Params; const Err = error{ - Unexpected, AccessDenied, - OutOfMemory, - InputOutput, - SystemResources, - IsDir, - OperationAborted, BrokenPipe, + ColumnNotFound, ConnectionResetByPeer, ConnectionTimedOut, - NotOpenForReading, - NetNameDeleted, - WouldBlock, - StreamTooLong, - Malformatted, - InvalidLength, - InvalidCharacter, - NoSpaceLeft, - PqError, - ColumnNotFound, + DeviceBusy, DiskQuota, FileTooBig, - DeviceBusy, + InputOutput, InvalidArgument, - NotOpenForWriting, - LockViolation, + InvalidCharacter, + InvalidLength, InvalidRequestMethod, + IsDir, + LockViolation, + Malformatted, + NetNameDeleted, + NoSpaceLeft, + NotOpenForReading, + NotOpenForWriting, + OperationAborted, + OutOfMemory, + PqError, + SocketNotConnected, + StreamTooLong, + SystemResources, + Unexpected, + WouldBlock, }; const Ctx = struct { db: pq.Db, @@ -204,7 +205,7 @@ fn get_comment(res: *Response, ctx: Ctx, _: Params) Err!void { fn post_comment(res: *Response, ctx: Ctx, _: Params) Err!void { var body_aa = std.ArrayList(u8).init(res.allocator); try res.reader().readAllArrayList(&body_aa, 1_000_000); - var body = try body_aa.toOwnedSlice(); + const body = try body_aa.toOwnedSlice(); var form = try zws.Form.parse(res.allocator, body); const Form = struct { url: []const u8, -- cgit v1.2.3-ZIG